diff --git a/backend/docker/Dockerfile b/backend/docker/Dockerfile index f20a5f02b..bd43dd9aa 100644 --- a/backend/docker/Dockerfile +++ b/backend/docker/Dockerfile @@ -86,8 +86,15 @@ USER node WORKDIR /usr/src/app ENV NODE_ENV=production -COPY --chown=node --from=builder /usr/src/app/backend/dist ./ -COPY --chown=node backend/package.json package.json +COPY --chown=node package.json package.json COPY --chown=node --from=prod-dependencies /usr/src/app/node_modules ./node_modules -CMD ["node", "main.js"] +COPY --chown=node backend/package.json backend/package.json +COPY --chown=node --from=builder /usr/src/app/backend/dist backend/dist +COPY --chown=node backend/public backend/public + +COPY --chown=node commons/package.json /usr/src/app/commons/package.json +COPY --chown=node --from=prod-dependencies /usr/src/app/commons/dist commons/dist + +WORKDIR /usr/src/app/backend +CMD ["node", "dist/main.js"] diff --git a/frontend/docker/Dockerfile b/frontend/docker/Dockerfile index f0093bcc0..2010b4a7b 100644 --- a/frontend/docker/Dockerfile +++ b/frontend/docker/Dockerfile @@ -43,12 +43,14 @@ ENV NEXT_TELEMETRY_DISABLED=1 WORKDIR /usr/src/app COPY --from=builder --chown=node:node /usr/src/app/frontend/.next/standalone ./ -COPY --from=builder --chown=node:node /usr/src/app/frontend/.next/static ./.next/static -COPY --from=builder /usr/src/app/frontend/next.config.js next.config.js -COPY --from=builder /usr/src/app/frontend/public ./public +COPY --from=builder --chown=node:node /usr/src/app/frontend/.next/static ./frontend/.next/static +COPY --from=builder /usr/src/app/frontend/next.config.js ./frontend/next.config.js +COPY --from=builder /usr/src/app/frontend/public ./frontend/public USER node ENV PORT 3001 EXPOSE 3001/tcp -CMD ["node", "frontend/server.js"] + +WORKDIR /usr/src/app/frontend +CMD ["node", "server.js"]