-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
209 lines (199 loc) · 5.99 KB
/
docker-compose.yaml
File metadata and controls
209 lines (199 loc) · 5.99 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
services:
traefik:
image: traefik:v3.6.2
command:
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=dependencycontrol
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entryPoint.to=websecure
- --entrypoints.web.http.redirections.entryPoint.scheme=https
- --entrypoints.websecure.address=:443
- --entrypoints.websecure.http.tls=true
- --entrypoints.websecure.http.tls.options=modern@file
- --providers.file.filename=/etc/traefik/dynamic.yml
- --accesslog=true
- --log.level=INFO
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/traefik_dynamic.yml:/etc/traefik/dynamic.yml:ro
networks:
- dependencycontrol
mongodb:
image: mongo:8.0.16
volumes:
- mongodb_data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=secret
networks:
- dependencycontrol
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:8-alpine
command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
networks:
- dependencycontrol
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
ollama:
image: ollama/ollama:latest
volumes:
- ollama_data:/root/.ollama
healthcheck:
test: ["CMD", "ollama", "list"]
interval: 30s
timeout: 10s
retries: 5
restart: unless-stopped
networks:
- dependencycontrol
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=minioadmin
- MINIO_ROOT_PASSWORD=minioadmin
volumes:
- minio_data:/data
networks:
- dependencycontrol
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "9001:9001"
backend:
build:
context: .
dockerfile: backend/Dockerfile
depends_on:
mongodb:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
ollama:
condition: service_started
healthcheck:
test: curl --fail http://localhost:8000/health/live || exit 1
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
environment:
- MONGODB_URL=mongodb://admin:secret@mongodb:27017
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=changethis_secret_key_for_jwt_tokens
- ALGORITHM=HS256
- ACCESS_TOKEN_EXPIRE_MINUTES=30
- REFRESH_TOKEN_EXPIRE_DAYS=7
- FRONTEND_BASE_URL=https://dependencycontrol.local
- S3_ENDPOINT_URL=http://minio:9000
- S3_ACCESS_KEY=minioadmin
- S3_SECRET_KEY=minioadmin
- S3_BUCKET_NAME=dc-archives
- S3_REGION=us-east-1
- S3_USE_SSL=false
- ARCHIVE_ENCRYPTION_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
- OLLAMA_BASE_URL=http://ollama:11434
- OLLAMA_MODEL=gemma4:e4b
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
labels:
traefik.enable: "true"
traefik.http.routers.backend.rule: "Host(`api.dependencycontrol.local`)"
traefik.http.routers.backend.entrypoints: websecure
traefik.http.routers.backend.tls: "true"
traefik.http.routers.backend.tls.options: modern@file
traefik.http.services.backend.loadbalancer.server.port: "8000"
traefik.http.routers.backend.middlewares: secure-headers-backend@file
networks:
- dependencycontrol
frontend:
build: ./frontend
environment:
- VITE_API_URL=https://api.dependencycontrol.local/api/v1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
labels:
traefik.enable: "true"
traefik.http.routers.frontend.rule: "Host(`dependencycontrol.local`)"
traefik.http.routers.frontend.entrypoints: websecure
traefik.http.routers.frontend.tls: "true"
traefik.http.routers.frontend.tls.options: modern@file
traefik.http.services.frontend.loadbalancer.server.port: "80"
traefik.http.routers.frontend.middlewares: secure-headers-frontend@file
networks:
- dependencycontrol
metabase:
image: metabase/metabase:latest
volumes:
- /dev/urandom:/dev/random:ro
depends_on:
- postgres
labels:
traefik.enable: "true"
traefik.docker.network: dependencycontrol
traefik.http.routers.metabase.rule: "Host(`metabase.local`)"
traefik.http.routers.metabase.entrypoints: websecure
traefik.http.routers.metabase.tls: "true"
traefik.http.routers.metabase.tls.options: modern@file
traefik.http.services.metabase.loadbalancer.server.port: "3000"
traefik.http.routers.metabase.middlewares: secure-headers-frontend@file
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: metabase_db
MB_DB_PORT: 5432
MB_DB_USER: metabase
MB_DB_PASS: metabase_password
MB_DB_HOST: postgres
healthcheck:
test: curl --fail -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 5
networks:
- dependencycontrol
postgres:
image: postgres:18
environment:
- POSTGRES_USER=metabase
- POSTGRES_PASSWORD=metabase_password
- POSTGRES_DB=metabase_db
volumes:
- pg_data:/var/lib/postgresql
networks:
- dependencycontrol
healthcheck:
test: ["CMD-SHELL", "pg_isready -U metabase -d metabase_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
dependencycontrol:
name: dependencycontrol
volumes:
mongodb_data:
redis_data:
minio_data:
pg_data:
ollama_data: