canina/scripts/compose.stage.yml
parsa aghaei 501addc909
All checks were successful
Deploy Canina / deploy (push) Successful in 5m39s
fix: CI/CD pipeline, dynamic API URLs, Dockerfile fixes
- Backend Dockerfile: add chown for node_modules (Prisma permissions fix)
- Frontend Dockerfile: add ARG/ENV for NEXT_PUBLIC_API_URL, VITE_API_URL
- nginx.conf: template with __PLACEHOLDERS__ for per-env substitution
- deploy.yml: SSH keepalive, sudo for VPN
- api.ts: dynamic API URL via env vars instead of hardcoded
- next.config.ts: rewrite only in development mode
- scripts: deploy.sh, compose.stage.yml, compose.prod.yml
2026-07-28 16:37:05 +03:30

73 lines
2.0 KiB
YAML

version: '3.8'
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
container_name: canino_backend_stage
restart: always
environment:
- DATABASE_URL=postgresql://canino_stage:caninopassword_stage@db_stage:5432/caninodb_stage?schema=public
- REDIS_HOST=redis_stage
- REDIS_PORT=6379
- PORT=3000
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:
NEXT_PUBLIC_API_URL: "https://stageapi.canina.ir/api"
VITE_API_URL: "https://stageapi.canina.ir"
container_name: canino_frontend_stage
restart: always
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.services.canina-stage.loadbalancer.server.port=8080"
depends_on:
- backend_stage
networks:
- traefik_public
networks:
traefik_public:
external: true
volumes:
canina_stage_db: