Add production Docker deployment configuration
- Add multi-stage Dockerfile for Next.js standalone build - Add docker-compose.deploy.yml for production deployment - Add entrypoint.sh for database migration and startup - Add .dockerignore for efficient Docker builds - Add docker/.env.production with all required env vars - Add Caddyfile.prod with security headers and optimizations - Update next.config.ts with output: standalone for Docker - Add DOCKER_DEPLOYMENT.md with comprehensive deployment guide
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Wait for database to be ready
|
||||
until pg_isready -h "${DB_HOST:-postgres}" -U "${POSTGRES_USER:-epicure}" -d "${POSTGRES_DB:-epicure}"; do
|
||||
echo "Waiting for PostgreSQL to be ready..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "PostgreSQL is ready!"
|
||||
|
||||
# Run migrations
|
||||
echo "Running database migrations..."
|
||||
cd /app/apps/web
|
||||
pnpm db:migrate || true
|
||||
|
||||
echo "Starting application..."
|
||||
exec node /app/apps/web/.next/standalone/server.js
|
||||
Reference in New Issue
Block a user