version: '3.9' services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_DB: ${POSTGRES_DB:-cloudlink} POSTGRES_USER: ${POSTGRES_USER:-cloudlink} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - ./data/postgres:/var/lib/postgresql/data - ./backend/src/db/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cloudlink}"] interval: 10s timeout: 5s retries: 5 backend: build: context: ./backend dockerfile: Dockerfile restart: unless-stopped environment: NODE_ENV: production PORT: 3001 DATABASE_URL: postgres://${POSTGRES_USER:-cloudlink}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-cloudlink} JWT_SECRET: ${JWT_SECRET} JWT_REFRESH_SECRET: ${JWT_REFRESH_SECRET} UPLOAD_DIR: /data/uploads MAX_FILE_SIZE_MB: ${MAX_FILE_SIZE_MB:-100} volumes: - ./data/uploads:/data/uploads depends_on: postgres: condition: service_healthy frontend: build: context: ./frontend dockerfile: Dockerfile args: VITE_API_URL: ${VITE_API_URL:-/api} VITE_WS_URL: ${VITE_WS_URL:-/ws} restart: unless-stopped nginx: image: nginx:alpine restart: unless-stopped ports: - "${HOST_PORT:-443}:443" - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/ssl:/etc/nginx/ssl:ro depends_on: - backend - frontend