b2ac623836
- 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
19 lines
428 B
Bash
19 lines
428 B
Bash
#!/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
|