-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
132 lines (123 loc) · 2.99 KB
/
docker-compose.yaml
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
services:
tracking_server:
restart: always
image: ghcr.io/mlflow/mlflow:latest
container_name: mlflow_server
ports:
- "${MLFLOW_PORT}:5000"
networks:
backend:
aliases:
- tracking_server
environment:
- MLFLOW_TRACKING_URI=http://tracking_server:5000
volumes:
- mlflow_data:/mlflow
command: >
mlflow server
--backend-store-uri sqlite:////mlflow/mlflow.db
--host 0.0.0.0
--port 5000
vault:
restart: always
image: vault:1.13.3
container_name: vault_server
ports:
- "${VAULT_PORT}:8200"
networks:
- frontend
- backend
environment:
VAULT_DEV_ROOT_TOKEN_ID: ${VAULT_DEV_ROOT_TOKEN}
VAULT_ADDR: "http://0.0.0.0:${VAULT_PORT}"
VAULT_API_ADDR: "http://localhost:${VAULT_PORT}"
entrypoint: >
/bin/sh -c "
vault server -dev -dev-root-token-id=${VAULT_DEV_ROOT_TOKEN} -dev-listen-address=0.0.0.0:${VAULT_PORT}"
vault-init:
image: vault:1.13.3
container_name: vault_initializer
depends_on:
- vault
networks:
- frontend
- backend
environment:
VAULT_PORT: ${VAULT_PORT}
VAULT_DEV_ROOT_TOKEN_ID: ${VAULT_DEV_ROOT_TOKEN}
VAULT_ADDR: "http://vault:${VAULT_PORT}"
VAULT_API_ADDR: "http://vault:${VAULT_PORT}"
entrypoint: >
/bin/sh -c "
sleep 5 &&
export VAULT_TOKEN=${VAULT_DEV_ROOT_TOKEN} &&
vault secrets enable -path=kv kv &&
vault kv put kv/APIKEY apikey=${API_KEY} &&
echo 'Vault initialization complete.'"
redis:
restart: always
image: redis:latest
container_name: redis_server
ports:
- "${REDIS_PORT}:6379"
networks:
- frontend
- backend
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
redis_ui:
restart: always
image: redis/redis-stack:latest
container_name: redis_ui
ports:
- "${REDIS_UI_PORT}:8001"
networks:
- frontend
- backend
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
depends_on:
- redis
api:
build:
context: .
dockerfile: Dockerfile
container_name: api_server
restart: always
ports:
- "8000:8000"
command: uvicorn src.main:app --host 0.0.0.0 --port 8000
networks:
- frontend
- backend
depends_on:
- redis
worker:
build:
context: .
dockerfile: Dockerfile
command: bash -c "PYTHONPATH=/app/src rq worker training-queue"
container_name: rq_worker
working_dir: /app
links:
- tracking_server
restart: always
depends_on:
- redis
- tracking_server
environment:
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- PYTHONPATH=/app/src
- MLFLOW_TRACKING_URI=http://tracking_server:5000
networks:
- backend
volumes:
mlflow_data:
networks:
frontend:
driver: bridge
backend:
driver: bridge