mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-01-02 01:30:38 -06:00
updated dockerfile for custom server.js file
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -24,6 +24,7 @@ COPY . .
|
||||
|
||||
RUN yarn run prisma-generate-build
|
||||
RUN yarn run build
|
||||
RUN rm -rf ./next/standalone
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
@@ -38,15 +39,14 @@ RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Set the correct permission for prerender cache
|
||||
RUN mkdir .next
|
||||
RUN chown nextjs:nodejs .next
|
||||
|
||||
# Automatically leverage output traces to reduce image size
|
||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/dist ./dist
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||
|
||||
USER nextjs
|
||||
|
||||
@@ -54,4 +54,4 @@ ENV PORT=3000
|
||||
|
||||
# server.js is created by next build from the standalone output
|
||||
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
|
||||
CMD HOSTNAME="0.0.0.0" node server.js
|
||||
CMD HOSTNAME="0.0.0.0" npm run start-prod
|
||||
Reference in New Issue
Block a user