-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (107 loc) · 3.4 KB
/
docker-compose.yml
File metadata and controls
114 lines (107 loc) · 3.4 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
# Boost Data Collector - Docker Compose
# Runs: Redis, Django (gunicorn), Celery worker, Celery beat, Selenium.
# 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
selenium:
image: selenium/standalone-chrome:145.0-chromedriver-145.0-20260222
platform: linux/amd64
shm_size: "2g"
ports:
- "127.0.0.1:4444:4444"
healthcheck:
test:
[
"CMD-SHELL",
'curl -sf http://localhost:4444/status | grep -qE ''"ready"[[:space:]]*:[[:space:]]*true'' || exit 1',
]
interval: 10s
timeout: 10s
retries: 12
start_period: 60s
web:
build: .
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "127.0.0.1:8000:8000"
env_file: .env
environment:
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}
SELENIUM_HUB_URL: http://selenium:4444/wd/hub
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
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
environment:
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
SELENIUM_HUB_URL: http://selenium:4444/wd/hub
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
extra_hosts:
- "host.docker.internal:host-gateway"
env_file: .env
environment:
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: