Refactor Docker entrypoint to run Prisma migrations; update schema

Co-authored-by: dennis <dennis@konkol.net>
This commit is contained in:
Cursor Agent
2026-01-12 15:08:23 +00:00
parent 80f57184c7
commit f1cc398248
7 changed files with 291 additions and 250 deletions

View File

@@ -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"]