HH/docker-compose.staging.yml
ismail 09933e1a69
Some checks failed
Build and Push Docker Image / build (push) Failing after 33s
update config
2026-04-19 14:10:17 +03:00

145 lines
3.2 KiB
YAML

services:
caddy:
image: caddy:2-alpine
container_name: px360_caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
- static_volume:/srv/static
- media_volume:/srv/media
depends_on:
web:
condition: service_healthy
networks:
- px360_net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
web:
image: ${PX360_IMAGE:-10.10.1.132:3000/marwan/hh:staging}
container_name: px360_web
restart: unless-stopped
volumes:
- static_volume:/app/staticfiles
- media_volume:/app/media
env_file:
- .env.staging
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${POSTGRES_USER:-px360}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- px360_net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
celery:
image: ${PX360_IMAGE:-10.10.1.132:3000/marwan/hh:staging}
container_name: px360_celery
restart: unless-stopped
command: celery -A config worker -l info --concurrency=2
env_file:
- .env.staging
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${POSTGRES_USER:-px360}
depends_on:
web:
condition: service_healthy
networks:
- px360_net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
celery-beat:
image: ${PX360_IMAGE:-10.10.1.132:3000/marwan/hh:staging}
container_name: px360_celery_beat
restart: unless-stopped
command: celery -A config beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
env_file:
- .env.staging
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USER=${POSTGRES_USER:-px360}
depends_on:
web:
condition: service_healthy
networks:
- px360_net
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
db:
image: postgres:15-alpine
container_name: px360_db
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB:-px360}
- POSTGRES_USER=${POSTGRES_USER:-px360}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-changeme}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-px360}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- px360_net
redis:
image: redis:7-alpine
container_name: px360_redis
restart: unless-stopped
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- px360_net
volumes:
postgres_data:
redis_data:
static_volume:
media_volume:
caddy_data:
caddy_config:
networks:
px360_net:
driver: bridge