-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (99 loc) · 2.79 KB
/
Copy pathdocker-compose.yml
File metadata and controls
109 lines (99 loc) · 2.79 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
services:
redis:
image: redis:latest
ports:
- "6383:6383"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 20s
retries: 2
start_period: 40s
volumes:
- redis_data:/data
api:
build: .
ports:
- "8006:8006"
volumes:
- .:/app
- temp_updates:/app/temp_updates
environment:
- PYTHONUNBUFFERED=1
- REDIS_DB=${REDIS_DB}
- REDIS_HOST=redis
- REDIS_PORT=6379
- CELERY_BROKER_URL=redis://redis:6379/${REDIS_DB}
- CELERY_RESULT_BACKEND=redis://redis:6379/${REDIS_DB}
depends_on:
redis:
condition: service_healthy
command: ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8006", "--workers", "2"]
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "8506:8506"
volumes:
- .:/app
- temp_updates:/app/temp_updates
- logs_data:/app/logs
environment:
- PYTHONUNBUFFERED=1
- MURRAY_PASSWORD=${MURRAY_PASSWORD:-}
# Remove any connection to Redis or Celery
command: ["streamlit", "run", "app.py", "--server.port=8506", "--server.address=0.0.0.0"]
# No longer depends on other services
# healthcheck:
# test: ["CMD", "curl", "--fail", "http://localhost:8505/_stcore/health"]
# interval: 10s
# timeout: 10s
# retries: 3
celery_worker:
build: .
volumes:
- .:/app
- temp_updates:/app/temp_updates
environment:
- PYTHONUNBUFFERED=1
- REDIS_DB=${REDIS_DB}
- REDIS_HOST=redis
- REDIS_PORT=6379
- CELERY_BROKER_URL=redis://redis:6379/${REDIS_DB}
- CELERY_RESULT_BACKEND=redis://redis:6379/${REDIS_DB}
depends_on:
redis:
condition: service_healthy
command: ["celery", "-A", "tasks", "worker", "--loglevel=info", "--concurrency=2"]
shm_size: '512m'
flower:
build: .
ports:
- "5557:5557"
environment:
- PYTHONUNBUFFERED=1
- REDIS_DB=${REDIS_DB}
- REDIS_HOST=redis
- REDIS_PORT=6379
- CELERY_BROKER_URL=redis://redis:6379/${REDIS_DB}
- CELERY_RESULT_BACKEND=redis://redis:6379/${REDIS_DB}
- CELERY_EVENT_BACKEND=redis://redis:6379/${REDIS_DB}
- FLOWER_USER=${FLOWER_USER}
- FLOWER_PASSWORD=${FLOWER_PASSWORD}
depends_on:
redis:
condition: service_healthy
celery_worker:
condition: service_started
command: sh -c "celery -A tasks flower --port=5557 --basic_auth=$${FLOWER_USER}:$${FLOWER_PASSWORD}"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:5559/"]
# interval: 30s
# timeout: 20s
# retries: 3
# start_period: 40s
volumes:
redis_data: # Volume definition
temp_updates: # Volume definition
logs_data: # Volume definition