63 lines
1.5 KiB
YAML
63 lines
1.5 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: .
|
|
ports:
|
|
- "8001:8000" # Expose on host port 8001
|
|
volumes:
|
|
- static_volume:/app/staticfiles
|
|
- media_volume:/app/media
|
|
environment:
|
|
- SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-me}
|
|
- DEBUG=${DEBUG:-True}
|
|
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost,127.0.0.1}
|
|
- 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 |