-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (141 loc) · 3.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
141 lines (141 loc) · 3.7 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
services:
api:
build:
context: ./backend
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
mlflow:
condition: service_healthy
ports:
- "8000:8000"
- "8001:8001"
command: ["/app/scripts/start.sh"]
healthcheck:
test: ["CMD","python","-c","import urllib.request,sys;urllib.request.urlopen('http://localhost:8000/health');sys.exit(0)"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
worker:
build:
context: ./backend
env_file:
- .env
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
mlflow:
condition: service_healthy
command: ["/app/scripts/worker.sh"]
postgres:
image: postgres:16
environment:
POSTGRES_DB: rl_hedging
POSTGRES_USER: rl_user
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "55432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL","pg_isready -U rl_user -d rl_hedging"]
interval: 10s
timeout: 5s
retries: 6
start_period: 10s
redis:
image: redis:7
ports:
- "6380:6379"
healthcheck:
test: ["CMD","redis-cli","ping"]
interval: 10s
timeout: 5s
retries: 6
start_period: 5s
mlflow:
image: ghcr.io/mlflow/mlflow:latest
environment:
MLFLOW_TRACKING_URI: http://mlflow:5000
ports:
- "5001:5000"
command: ["mlflow","server","--host","0.0.0.0","--port","5000","--backend-store-uri","sqlite:///mlflow.db","--default-artifact-root","/mlruns"]
healthcheck:
test: ["CMD","python","-c","import urllib.request,sys;urllib.request.urlopen('http://localhost:5000/health');sys.exit(0)"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
prometheus:
image: prom/prometheus:latest
volumes:
- ./infra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./infra/monitoring/alert_rules.yml:/etc/prometheus/alert_rules.yml
ports:
- "9090:9090"
healthcheck:
test: ["CMD-SHELL","wget -qO- http://localhost:9090/-/healthy > /dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 6
start_period: 10s
grafana:
image: grafana/grafana:latest
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
ports:
- "3001:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./infra/grafana/provisioning:/etc/grafana/provisioning
- ./infra/grafana/dashboards:/var/lib/grafana/dashboards
depends_on:
prometheus:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL","wget -qO- http://localhost:3000/api/health > /dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
frontend:
build:
context: ./frontend
args:
NEXT_PUBLIC_API_URL: http://localhost:8080/api/v1
NEXT_PUBLIC_WS_URL: ws://localhost:8080
env_file:
- .env
ports:
- "3000:3000"
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD","node","-e","fetch('http://localhost:3000/').then(r=>{process.exit(r.ok?0:1)}).catch(()=>process.exit(1))"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
nginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf
depends_on:
api:
condition: service_healthy
frontend:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
grafana_data: