diff --git a/.github/workflows/publish_to_docker_hub.yaml b/.github/workflows/publish_to_docker_hub.yaml index cb42d80..1a0f3bf 100644 --- a/.github/workflows/publish_to_docker_hub.yaml +++ b/.github/workflows/publish_to_docker_hub.yaml @@ -59,6 +59,6 @@ jobs: with: context: . file: ./docker/Dockerfile - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7 push: true tags: ${{ steps.prep.outputs.tags }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 21599ff..e188ddd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,16 +1,20 @@ -FROM node:20-alpine as build +FROM node:20-alpine3.18 AS build WORKDIR /tmp COPY . . RUN npm ci && npm run build -FROM node:20-alpine -WORKDIR /usr/src/app +FROM node:20-alpine3.18 AS prod +WORKDIR /tmp_prod COPY --from=build /tmp/dist ./dist COPY --from=build /tmp/docker/run.sh ./run.sh COPY --from=build /tmp/package.json ./package.json COPY --from=build /tmp/package-lock.json ./package-lock.json -RUN apk add --no-cache jq \ - && npm ci --only=production +RUN npm ci --only=production + +FROM node:20-alpine +WORKDIR /usr/src/app +COPY --from=prod /tmp_prod ./ +RUN apk add --no-cache jq RUN apk add --no-cache bash EXPOSE 3000 VOLUME ["/data"]