-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.pull.yml
More file actions
86 lines (81 loc) · 2.62 KB
/
docker-compose.pull.yml
File metadata and controls
86 lines (81 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Docker Compose for CHAD Pull-Only Deployment
#
# This configuration runs CHAD in pull-only mode, which:
# - Queries OpenSearch on a schedule instead of receiving pushed logs
# - Does not require worker processes (scheduler runs in-process)
# - Has a smaller resource footprint
#
# Usage:
# docker compose -f docker-compose.pull.yml up -d
#
# For hybrid push+pull mode, use the standard docker-compose.yml instead.
services:
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes --loglevel warning
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: chad
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: chad
command: ["postgres", "-c", "log_min_messages=${POSTGRES_LOG_LEVEL:-warning}", "-c", "log_checkpoints=${POSTGRES_LOG_CHECKPOINTS:-off}"]
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chad"]
interval: 5s
timeout: 5s
retries: 5
backend:
image: ghcr.io/terrifiedbug/chad/chad-backend:${VERSION:-latest}
command: >
uvicorn app.main:app --host 0.0.0.0 --port 8000 --log-level ${LOG_LEVEL:-warning} --no-access-log --workers ${UVICORN_WORKERS:-2}
environment:
# Database
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=chad
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=chad
- DATABASE_POOL_SIZE=${DATABASE_POOL_SIZE:-10}
- DATABASE_MAX_OVERFLOW=${DATABASE_MAX_OVERFLOW:-20}
# Redis (for caching and scheduler)
- REDIS_URL=${REDIS_URL:-redis://redis:6379}
# Pull-only mode (disables push features)
- CHAD_MODE=pull
# Security (REQUIRED - must be set in production)
- JWT_SECRET_KEY=${JWT_SECRET_KEY}
- SESSION_SECRET_KEY=${SESSION_SECRET_KEY}
- CHAD_ENCRYPTION_KEY=${CHAD_ENCRYPTION_KEY}
# Application URL
- APP_URL=${APP_URL:-http://localhost}
# Additional allowed hosts for CSRF (comma-separated)
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-}
# Logging
- LOG_LEVEL=${LOG_LEVEL:-warning}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- chad_data:/data
frontend:
image: ghcr.io/terrifiedbug/chad/chad-frontend:${VERSION:-latest}
ports:
- "80:80"
depends_on:
- backend
volumes:
pgdata:
redis_data:
chad_data: