Skip to content

Commit

Permalink
Fix production docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
akmatoff committed Oct 16, 2024
1 parent 61fe248 commit fb4761c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,17 @@ ENV NODE_ENV=production
ENV PORT=8000
ENV HOSTNAME="0.0.0.0"

COPY --from=deps /codium-website/node_modules ./node_modules
COPY --from=builder /codium-website/.next ./.next
COPY --from=builder /codium-website/public ./public
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder --chown=nextjs:nodejs /codium-website/public ./public

RUN mkdir .next
RUN chown nextjs:nodejs .next

COPY --from=builder --chown=nextjs:nodejs /codium-website/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /codium-website/.next/static ./.next/static

EXPOSE 8000

CMD ["node", ".next/standalone/server.js"]
CMD ["node", "server.js"]

0 comments on commit fb4761c

Please sign in to comment.