Files
DJ-Management-Tool/docker-compose.prod.yml
T
spliceboti ec2ab0e9f4 Enable containerization for simplified deployment and scaling of the app
Adds Dockerfile, docker-compose files, and deployment scripts for containerizing the React/Express app.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 3a22ac80-cd1d-4441-9e36-f24fc2f4c3de
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3478f7c3-db8c-4fca-9165-3adbdf1b5829/e8da43e7-d99c-4328-9fdc-485bdeecffc1.jpg
2025-07-10 00:35:23 +00:00

78 lines
1.8 KiB
YAML

version: '3.8'
services:
app:
build:
context: .
target: production
ports:
- "5000:5000"
environment:
- NODE_ENV=production
- DATABASE_URL=${DATABASE_URL}
- SESSION_SECRET=${SESSION_SECRET}
- REPLIT_DOMAINS=${REPLIT_DOMAINS}
- REPL_ID=${REPL_ID}
- ISSUER_URL=${ISSUER_URL:-https://replit.com/oidc}
depends_on:
db:
condition: service_healthy
volumes:
- uploads_data:/app/uploads
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5000/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:15-alpine
environment:
- POSTGRES_DB=${PGDATABASE:-dj_management}
- POSTGRES_USER=${PGUSER:-postgres}
- POSTGRES_PASSWORD=${PGPASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${PGUSER:-postgres} -d ${PGDATABASE:-dj_management}"]
interval: 10s
timeout: 5s
retries: 5
# Optional: Redis for session storage (alternative to PostgreSQL sessions)
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
# Optional: Nginx reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
depends_on:
- app
restart: unless-stopped
volumes:
postgres_data:
redis_data:
uploads_data: