Refactor Docker entrypoint to run Prisma migrations; update schema
Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
@@ -66,6 +66,7 @@ RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy the built application
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/scripts ./scripts
|
||||
|
||||
# Set the correct permission for prerender cache
|
||||
RUN mkdir .next
|
||||
@@ -82,6 +83,8 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
# Copy Prisma files
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
|
||||
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
||||
|
||||
# Note: Environment variables should be passed via docker-compose or runtime environment
|
||||
# DO NOT copy .env files into the image for security reasons
|
||||
@@ -97,4 +100,4 @@ ENV HOSTNAME="0.0.0.0"
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:3000/api/health || exit 1
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
CMD ["node", "scripts/start-with-migrate.js"]
|
||||
Reference in New Issue
Block a user