65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
services:
|
|
redis:
|
|
image: redis:7-alpine
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
networks:
|
|
- splitchat_network
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: splitchat
|
|
POSTGRES_USER: splitchat
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-splitchat_password_123}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U splitchat"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- splitchat_network
|
|
|
|
web:
|
|
build: .
|
|
expose:
|
|
- "8000"
|
|
volumes:
|
|
- static_volume:/app/staticfiles
|
|
- media_volume:/app/media
|
|
environment:
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- DEBUG=${DEBUG:-False}
|
|
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
|
|
- CSRF_TRUSTED_ORIGINS=${CSRF_TRUSTED_ORIGINS}
|
|
- DATABASE_URL=postgres://splitchat:${DB_PASSWORD:-splitchat_password_123}@db:5432/splitchat
|
|
- REDIS_URL=redis://redis:6379/0
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- splitchat_network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
static_volume:
|
|
media_volume:
|
|
|
|
networks:
|
|
splitchat_network:
|
|
driver: bridge
|