2
0

fix(docker): 🐛 Fix the whole docker deployment pipeline

I've been able to deploy the application on another machine (finally).
This commit is contained in:
Baptiste Arnaud
2022-03-29 08:45:20 +02:00
parent c64afb7073
commit 1f992c6779
9 changed files with 39 additions and 22 deletions

View File

@ -18,14 +18,12 @@ FROM base AS builder
COPY --from=installer /app/ .
COPY --from=pruner /app/out/full/ .
RUN apt-get -qy update && apt-get -qy install openssl
RUN yarn turbo run build --scope=${SCOPE} --include-dependencies --no-deps
RUN yarn turbo run build --scope=${SCOPE} --include-dependencies
RUN find . -name node_modules | xargs rm -rf
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY ./packages/db/prisma ./prisma
COPY --from=installer /app/node_modules ./node_modules
COPY --from=builder /app/apps/${SCOPE}/next.config.js ./
@ -33,8 +31,7 @@ COPY --from=builder /app/apps/${SCOPE}/public ./public
COPY --from=builder /app/apps/${SCOPE}/package.json ./package.json
COPY --from=builder /app/apps/${SCOPE}/.next/standalone ./
COPY --from=builder /app/apps/${SCOPE}/.next/static ./.next/static
RUN chown -Rf nextjs:nodejs /app
USER nextjs
RUN apt-get -qy update && apt-get -qy install openssl
EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]