Files
canina/scripts/compose.stage.yml
T
2026-10-26 13:45:41 +03:30

102 lines
3.2 KiB
YAML

services:
db_stage:
image: postgres:16-alpine
container_name: canino_db_stage
restart: always
environment:
POSTGRES_USER: canino_stage
POSTGRES_PASSWORD: caninopassword_stage
POSTGRES_DB: caninodb_stage
volumes:
- canina_stage_db:/var/lib/postgresql/data
networks:
- traefik_public
redis_stage:
image: redis:7-alpine
container_name: canino_redis_stage
restart: always
networks:
- traefik_public
backend_stage:
build:
context: ./backend
dockerfile: Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.parsaaghayi.ir/repository/npm/}
container_name: canino_backend_stage
restart: always
env_file:
- path: .support-chat.env
required: false
- path: .revalidation.env
required: false
dns:
- 217.218.127.127
- 217.218.155.155
environment:
- DATABASE_URL=postgresql://canino_stage:caninopassword_stage@db_stage:5432/caninodb_stage?schema=public
- SUPPORT_CHAT_URL=http://canina-bot:8643/support/ask
- REDIS_HOST=redis_stage
- REDIS_PORT=6379
- PORT=3000
- FRONTEND_URL=https://stage.canina.ir
# Direct Next port avoids nginx /api forwarding back into this backend.
- FRONTEND_INTERNAL_URL=http://frontend_stage:3000
# Code-only stage startup: schema/seed changes require separate authorization.
command: ["node", "dist/main.js"]
volumes:
- canina_stage_uploads:/app/uploads
- /opt/services/proxy/certs/canina:/app/ssl_certs
labels:
- "traefik.enable=true"
- "traefik.http.routers.canina-api-stage.rule=Host(`stageapi.canina.ir`)"
- "traefik.http.routers.canina-api-stage.entrypoints=websecure"
- "traefik.http.routers.canina-api-stage.tls=true"
- "traefik.http.services.canina-api-stage.loadbalancer.server.port=3000"
depends_on:
- db_stage
- redis_stage
networks:
- traefik_public
frontend_stage:
build:
context: .
dockerfile: Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY:-https://registry.parsaaghayi.ir/repository/npm/}
NEXT_PUBLIC_API_URL: "https://stageapi.canina.ir/api"
VITE_API_URL: "https://stageapi.canina.ir"
container_name: canino_frontend_stage
restart: always
environment:
- INTERNAL_API_URL=http://backend_stage:3000/api
env_file:
- path: .revalidation.env
required: false
dns:
- 217.218.127.127
- 217.218.155.155
labels:
- "traefik.enable=true"
- "traefik.http.routers.canina-stage.rule=Host(`stage.canina.ir`) || Host(`stageadmin.canina.ir`)"
- "traefik.http.routers.canina-stage.entrypoints=websecure"
- "traefik.http.routers.canina-stage.tls=true"
- "traefik.http.routers.canina-stage.middlewares=staging-robots-headers"
- "traefik.http.middlewares.staging-robots-headers.headers.customresponseheaders.X-Robots-Tag=noindex, nofollow, nosnippet, noarchive"
- "traefik.http.services.canina-stage.loadbalancer.server.port=8080"
depends_on:
- backend_stage
networks:
- traefik_public
networks:
traefik_public:
external: true
volumes:
canina_stage_db:
canina_stage_uploads: