services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: songs2vid POSTGRES_PASSWORD: songs2vid POSTGRES_DB: songs2vid volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U songs2vid -d songs2vid"] interval: 5s timeout: 5s retries: 10 redis: image: redis:7-alpine restart: unless-stopped command: ["redis-server", "--appendonly", "yes"] volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 web: build: . restart: unless-stopped ports: - "${S2VID_PORT:-3000}:3000" env_file: - .env environment: DATABASE_URL: postgresql://songs2vid:songs2vid@postgres:5432/songs2vid REDIS_URL: redis://redis:6379 UPLOAD_DIR: /app/uploads NEXTAUTH_URL: ${NEXTAUTH_URL:-http://localhost:3000} volumes: - uploads_data:/app/uploads depends_on: postgres: condition: service_healthy redis: condition: service_healthy command: > sh -c "npx prisma db push && node server.js" worker: build: . restart: unless-stopped env_file: - .env environment: DATABASE_URL: postgresql://songs2vid:songs2vid@postgres:5432/songs2vid REDIS_URL: redis://redis:6379 UPLOAD_DIR: /app/uploads volumes: - uploads_data:/app/uploads depends_on: postgres: condition: service_healthy redis: condition: service_healthy command: ["npx", "tsx", "worker/index.ts"] volumes: postgres_data: redis_data: uploads_data: