# Pull-only staging stack — uses images from a registry (Gitea Packages / Docker Hub / etc.). # No backend/frontend source on the deployment host except this compose file + config + secrets. # # Required env (see deploy.registry.env.example): # REGISTRY_PREFIX e.g. host.docker.internal:3000/admin (Windows CI) or wixur.ir:3000/admin (no protocol) # IMAGE_TAG short sha or "latest" (CI sets this per deploy) # Optional: # DEPLOY_SECRETS_DIR absolute path on the server to database/backend *.env files (see below) # # Deploy: # docker compose -f docker-compose.registry.yml --env-file deploy.registry.env pull # docker compose -f docker-compose.registry.yml --env-file deploy.registry.env up -d name: dyolink-registry services: postgres: image: postgres:15-alpine container_name: dyolink_postgres_staging env_file: - ${DEPLOY_SECRETS_DIR:-.}/database.staging.env environment: TZ: UTC volumes: - postgres_data_staging:/var/lib/postgresql/data - ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro - ./database/backups:/backups networks: - dyolink_staging restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"] interval: 15s timeout: 10s retries: 5 start_period: 40s backend: image: ${REGISTRY_PREFIX}/dyolink-backend:${IMAGE_TAG:-latest} container_name: dyolink_backend_staging depends_on: postgres: condition: service_healthy env_file: - ${DEPLOY_SECRETS_DIR:-.}/backend.staging.env environment: NODE_ENV: production TZ: UTC PORT: "3000" expose: - "3000" networks: - dyolink_staging restart: unless-stopped healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/api/health', (r) => {if(r.statusCode!==200)process.exit(1)})"] interval: 30s timeout: 10s retries: 3 start_period: 60s frontend: image: ${REGISTRY_PREFIX}/dyolink-frontend:${IMAGE_TAG:-latest} container_name: dyolink_frontend_staging depends_on: - backend environment: NODE_ENV: production TZ: UTC PORT: "3000" HOSTNAME: "0.0.0.0" expose: - "3000" networks: - dyolink_staging restart: unless-stopped healthcheck: # Root redirects to /en (next-intl) — accept 2xx/3xx as healthy. test: ["CMD", "node", "-e", "require('http').get('http://127.0.0.1:3000/', (r) => { process.exit(r.statusCode >= 200 && r.statusCode < 400 ? 0 : 1); }).on('error', () => process.exit(1))"] interval: 30s timeout: 10s retries: 3 start_period: 60s nginx: image: nginx:alpine container_name: dyolink_nginx_staging depends_on: backend: condition: service_healthy frontend: condition: service_healthy ports: # Bind a private localhost port — Windows portproxy owns public 80 (http://wixur.ir). # See STAGING-DEPLOY.md §7: portproxy 0.0.0.0:80 → 127.0.0.1:18088 - "127.0.0.1:${STAGING_LOCAL_PORT:-18088}:80" volumes: - ./nginx/http-only.conf:/etc/nginx/conf.d/default.conf:ro - ./logs/nginx-staging:/var/log/nginx networks: - dyolink_staging restart: unless-stopped networks: dyolink_staging: name: dyolink_staging volumes: postgres_data_staging: name: dyolink_postgres_data_staging