- Use pnpm deploy --prod for pruned production node_modules (smaller image) - Add docker-entrypoint.sh with optional Prisma migration support (RUN_MIGRATIONS) - Copy generated Prisma client explicitly into production stage - Add OCI image labels for container registry metadata - Update .dockerignore: exclude apps/web, libs/ai-services, agent configs, Python artifacts - Add build directive + RUN_MIGRATIONS env to docker-compose.prod.yml - Maintain non-root user, dumb-init signal handling, and healthcheck Co-Authored-By: Paperclip <noreply@paperclip.ing>
19 lines
634 B
Bash
Executable File
19 lines
634 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
# =============================================================================
|
|
# GoodGo API — Docker Entrypoint
|
|
#
|
|
# Optionally runs Prisma migrations before starting the application.
|
|
# Set RUN_MIGRATIONS=true to apply pending migrations on startup.
|
|
# In Kubernetes, prefer running migrations as an init container instead.
|
|
# =============================================================================
|
|
|
|
if [ "${RUN_MIGRATIONS}" = "true" ]; then
|
|
echo "[entrypoint] Running Prisma migrations..."
|
|
npx prisma migrate deploy --schema ./prisma/schema.prisma
|
|
echo "[entrypoint] Migrations complete."
|
|
fi
|
|
|
|
exec "$@"
|