-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
63 lines (59 loc) · 1.55 KB
/
docker-compose.yml
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
# docker-compose.yml
services:
jobalizer:
image: jobalizer:latest
container_name: jobalizer
ports:
- "5000:5000"
env_file:
- .env
environment:
FLASK_APP: "app:create_app()"
FLASK_ENV: "${FLASK_ENV:-development}"
OPENAI_API_KEY: "${OPENAI_API_KEY:-your_openai_api_key}"
FLASK_SECRET_KEY: "${FLASK_SECRET_KEY:-your_secret_key}"
CELERY_BROKER_URL: "redis://redis:6379/0"
CELERY_RESULT_BACKEND: "redis://redis:6379/0"
SOCKETIO_MESSAGE_QUEUE: "redis://redis:6379/0"
restart: unless-stopped
volumes:
- .:/app # Map the host directory to the container directory for live code updates
depends_on:
- redis
- celery_worker
redis:
image: redis:alpine
container_name: redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
celery_worker:
image: jobalizer:latest
container_name: celery_worker
command: celery -A app.celery worker --loglevel=info
env_file:
- .env
environment:
CELERY_BROKER_URL: "redis://redis:6379/0"
CELERY_RESULT_BACKEND: "redis://redis:6379/0"
SOCKETIO_MESSAGE_QUEUE: "redis://redis:6379/0"
volumes:
- .:/app
depends_on:
- redis
restart: unless-stopped
healthcheck:
test: ["CMD", "celery", "-A", "app.celery", "status"]
interval: 30s
timeout: 10s
retries: 5
volumes:
redis-data:
driver: local