-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (134 loc) · 4.67 KB
/
docker-compose.yml
File metadata and controls
141 lines (134 loc) · 4.67 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Boost Data Collector - Docker Compose
# Runs: Redis, Django (gunicorn), Celery worker, Celery beat.
# Optional: slack-chromium (profile slack-session) for noVNC Slack login on headless hosts.
# DATABASE_URL must be set in .env (host Postgres, or postgres://...@db:5432/... if you enable db).
services:
# db:
# image: postgres:16-alpine
# environment:
# POSTGRES_USER: ${POSTGRES_USER:-boost}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-boost}
# POSTGRES_DB: ${POSTGRES_DB:-boost_dashboard}
# volumes:
# - postgres_data:/var/lib/postgresql/data
# healthcheck:
# test:
# [
# "CMD-SHELL",
# "pg_isready -U ${POSTGRES_USER:-boost} -d ${POSTGRES_DB:-boost_dashboard}",
# ]
# interval: 5s
# timeout: 5s
# retries: 5
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
slack-chromium:
profiles: ["slack-session"]
image: selenium/standalone-chrome:145.0-chromedriver-145.0-20260222
platform: linux/amd64
shm_size: "2g"
ports:
- "127.0.0.1:7900:7900"
volumes:
# Chrome profile only (no full workspace mount — least privilege for noVNC login).
- ./workspace/slack_event_handler/chrome_profile:/home/seluser/.config/google-chrome
environment:
SE_BROWSER_ARGS_USER_DATA_DIR: "--user-data-dir=/home/seluser/.config/google-chrome"
SE_BROWSER_ARGS_NO_SANDBOX: "--no-sandbox"
SE_BROWSER_ARGS_DISABLE_DEV_SHM: "--disable-dev-shm-usage"
web:
build: .
restart: unless-stopped
user: "0:0"
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:8000:8000"
env_file: .env
environment:
ALLOW_ROOT_ENTRYPOINT: "1"
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL in .env (e.g. host.docker.internal or db:5432 with db service enabled)}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,web,0.0.0.0}
CHROME_PROFILE_PATH: /app/workspace/slack_event_handler/chrome_profile
volumes:
- ./workspace:/app/workspace
- ./logs:/app/logs
- ./staticfiles:/app/staticfiles
depends_on:
# db: { condition: service_healthy }
redis: { condition: service_healthy }
celery_worker:
build: .
restart: unless-stopped
user: "0:0"
# Override image HTTP HEALTHCHECK (no gunicorn on :8000 in this service).
# Broker-backed probe: /proc/cmdline parsing was flaky on CI (worker unhealthy during --wait).
healthcheck:
test:
[
"CMD-SHELL",
'python -c "import glob,sys; sys.exit(0 if any(b\"celery\" in (d:=open(p,\"rb\").read()) and b\"worker\" in d for p in glob.glob(\"/proc/[0-9]*/cmdline\")) else 1)"',
]
interval: 30s
timeout: 15s
retries: 5
start_period: 90s
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
environment:
ALLOW_ROOT_ENTRYPOINT: "1"
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL in .env (e.g. host.docker.internal or db:5432 with db service enabled)}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
CHROME_PROFILE_PATH: /app/workspace/slack_event_handler/chrome_profile
volumes:
- ./workspace:/app/workspace
- ./logs:/app/logs
command: celery -A config worker -l info
depends_on:
# db: { condition: service_healthy }
redis: { condition: service_healthy }
celery_beat:
build: .
restart: unless-stopped
user: "0:0"
healthcheck:
test:
[
"CMD-SHELL",
'python -c "import glob,sys; sys.exit(0 if any(b\"celery\" in (d:=open(p,\"rb\").read()) and b\"beat\" in d for p in glob.glob(\"/proc/[0-9]*/cmdline\")) else 1)"',
]
interval: 30s
timeout: 5s
retries: 5
start_period: 60s
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
environment:
ALLOW_ROOT_ENTRYPOINT: "1"
DATABASE_URL: ${DATABASE_URL:?Set DATABASE_URL in .env (e.g. host.docker.internal or db:5432 with db service enabled)}
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
volumes:
- ./workspace:/app/workspace
- ./logs:/app/logs
- celerybeat_data:/app/celerybeat
command: celery -A config beat -l info
depends_on:
# db: { condition: service_healthy }
redis: { condition: service_healthy }
celery_worker: { condition: service_started }
volumes:
postgres_data:
# workspace_data:
# logs_data:
celerybeat_data: