version: '3.8' services: postgres: image: postgres:15-alpine container_name: sharenet-postgres restart: unless-stopped environment: POSTGRES_DB: sharenet POSTGRES_USER: sharenet POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} volumes: - postgres_data:/var/lib/postgresql/data - ./migrations:/docker-entrypoint-initdb.d ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U sharenet"] interval: 30s timeout: 10s retries: 3 networks: - sharenet-network backend: image: ${REGISTRY:-ghcr.io}/${IMAGE_NAME:-your-username/sharenet}/backend:${IMAGE_TAG:-latest} container_name: sharenet-backend restart: unless-stopped environment: DATABASE_URL: postgresql://sharenet:${POSTGRES_PASSWORD:-changeme}@postgres:5432/sharenet RUST_LOG: info RUST_BACKTRACE: 1 ports: - "3001:3001" depends_on: postgres: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3001/health"] interval: 30s timeout: 10s retries: 3 networks: - sharenet-network frontend: image: ${REGISTRY:-ghcr.io}/${IMAGE_NAME:-your-username/sharenet}/frontend:${IMAGE_TAG:-latest} container_name: sharenet-frontend restart: unless-stopped environment: NEXT_PUBLIC_API_HOST: backend NEXT_PUBLIC_API_PORT: 3001 NODE_ENV: production ports: - "3000:3000" depends_on: backend: condition: service_healthy healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] interval: 30s timeout: 10s retries: 3 networks: - sharenet-network nginx: image: nginx:alpine container_name: sharenet-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/ssl:/etc/nginx/ssl:ro depends_on: - frontend - backend networks: - sharenet-network volumes: postgres_data: driver: local networks: sharenet-network: driver: bridge