-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (113 loc) · 2.5 KB
/
docker-compose.yml
File metadata and controls
120 lines (113 loc) · 2.5 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
services:
app:
build:
context: .
dockerfile: Dockerfile
image: algorithm-analysis-service-app:latest
container_name: alg_svc_api
environment:
DB_HOST: database
REDIS_HOST: redis
depends_on:
- database
- redis
ports:
- "8001:8000"
restart: always
networks:
- private_network
- public_network
volumes:
- app-data:/user/src/app
command:
- sh
- -c
- |
alembic upgrade head &&
python main.py server
worker:
image: algorithm-analysis-service-app:latest
environment:
DB_HOST: database
REDIS_HOST: redis
depends_on:
- database
- redis
- app
restart: always
networks:
- private_network
volumes:
- worker-data:/user/src/worker
command:
- sh
- -c
- |
celery -A main:celery_app worker -P threads -Q algorithm-analysis-service_execution --concurrency=1 -l INFO --without-gossip --without-mingle --without-heartbeat
database:
image: postgres:17.4-alpine3.21
container_name: alg_svc_postgres_db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: dev
networks:
- private_network
volumes:
- postgres-data:/var/lib/postgresql/data
command:
- "postgres"
- "-c"
- "search_path=public,service_algorithm_analysis"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
entrypoint:
- sh
- -c
- |
docker-entrypoint.sh postgres &
until pg_isready -U postgres; do sleep 1; done
psql -U postgres -d dev -c "CREATE SCHEMA IF NOT EXISTS service_algorithm_analysis;"
wait
redis:
image: redis:7.4.3-alpine
container_name: alg_svc_redis
command: ["redis-server"]
networks:
- private_network
gui:
build:
context: ./gui
dockerfile: Dockerfile
image: algorithm-analysis-service-gui:latest
container_name: alg_svc_gui
environment:
API_HOST: app
depends_on:
- app
ports:
- "8002:8501"
restart: always
networks:
- private_network
- public_network
volumes:
- gui-data:/user/src/gui
command:
- sh
- -c
- |
streamlit run home.py
networks:
private_network:
driver: bridge
public_network:
driver: bridge
volumes:
app-data:
gui-data:
postgres-data:
worker-data: