-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
286 lines (272 loc) · 8.36 KB
/
docker-compose.yml
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# docker version
version: "3"
services:
keycloak:
image: quay.io/keycloak/keycloak:${KEYCLOAK_VERSION-22.0.0}
command: ["start-dev", "--import-realm", "--http-port", "8088"]
environment:
KC_DB: postgres
KC_DB_URL_HOST: postgres
KC_DB_URL_DATABASE: jan-keycloak
KC_DB_PASSWORD: postgrespassword
KC_DB_USERNAME: postgres
KC_DB_SCHEMA: public
KC_HEALTH_ENABLED: "true"
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD-admin}
volumes:
- ./conf/keycloak_conf:/opt/keycloak/data/import
ports:
- "8088:8088"
depends_on:
postgres:
condition: service_healthy
networks:
jan_community:
ipv4_address: 172.20.0.9
postgres:
image: postgres:15
command: postgres -c jit=off
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
ports:
- "5432:5432"
healthcheck:
test: "exit 0"
volumes:
- ./conf/db/docker_psql_init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql
networks:
jan_community:
ipv4_address: 172.20.0.11
graphql-engine:
image: hasura/graphql-engine:v2.31.0.cli-migrations-v3
ports:
- 8080:8080
restart: always
env_file:
- conf/sample.env_app-backend
volumes:
- ./app-backend/hasura/migrations:/migrations
- ./app-backend/hasura/metadata:/metadata
depends_on:
data-connector-agent:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 30s
timeout: 10s
retries: 10
labels:
- "traefik.enable=true"
- "traefik.http.routers.graphql-engine.entrypoints=jan"
- "traefik.http.routers.graphql-engine.rule=(PathPrefix(`/graphql-engine`))"
- "traefik.http.middlewares.graphql-engine.stripprefix.prefixes=/graphql-engine"
- "traefik.http.middlewares.graphql-engine.stripprefix.forceslash=false"
- "traefik.http.routers.graphql-engine.middlewares=graphql-engine"
networks:
jan_community:
ipv4_address: 172.20.0.12
hasura-seed-apply:
image: hasura/graphql-engine:v2.31.0.cli-migrations-v3
entrypoint: [""]
command: ["/bin/sh", "-c", "hasura-cli seed apply --all-databases"]
env_file:
- conf/sample.env_app-backend
volumes:
- ./app-backend/hasura/config.yaml:/config.yaml
- ./app-backend/hasura/seeds:/seeds
depends_on:
graphql-engine:
condition: service_healthy
extra_hosts:
- "localhost:172.20.0.12"
networks:
jan_community:
worker:
build:
context: ./app-backend/worker
dockerfile: ./Dockerfile
restart: always
environment:
- "NODE_ENV=development"
volumes:
- ./app-backend/worker:/worker
ports:
- 8787:8787
networks:
jan_community:
ipv4_address: 172.20.0.13
data-connector-agent:
image: hasura/graphql-data-connector:v2.31.0
restart: always
ports:
- 8081:8081
environment:
QUARKUS_LOG_LEVEL: ERROR # FATAL, ERROR, WARN, INFO, DEBUG, TRACE
## https://quarkus.io/guides/opentelemetry#configuration-reference
QUARKUS_OPENTELEMETRY_ENABLED: "false"
## QUARKUS_OPENTELEMETRY_TRACER_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/api/v1/athena/health"]
interval: 5s
timeout: 10s
retries: 5
start_period: 5s
networks:
jan_community:
ipv4_address: 172.20.0.14
web:
build:
context: ./web-client
dockerfile: ./dev.Dockerfile
restart: always
volumes:
- ./web-client/:/app
- /app/node_modules
- /app/.next
env_file:
- conf/sample.env_web-client
ports:
- 3000:3000
environment:
NODE_ENV: development
extra_hosts:
- "localhost:172.20.0.9"
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.entrypoints=jan"
- "traefik.http.routers.web.rule=(Host(`localhost`) && PathPrefix(`/web`))"
- "traefik.http.routers.web.middlewares=rewritepath"
- "traefik.http.middlewares.rewritepath.addprefix.prefix=/web"
networks:
jan_community:
ipv4_address: 172.20.0.15
llm:
image: ghcr.io/abetlen/llama-cpp-python@sha256:b6d21ff8c4d9baad65e1fa741a0f8c898d68735fff3f3cd777e3f0c6a1839dd4
volumes:
- ./jan-inference/llm/models:/models
ports:
- 8000:8000
environment:
MODEL: /models/${LLM_MODEL_FILE}
PYTHONUNBUFFERED: 1
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.llm.entrypoints=jan"
- "traefik.http.routers.llm.rule=(PathPrefix(`/llm`))"
- "traefik.http.middlewares.llm.stripprefix.prefixes=/llm"
- "traefik.http.middlewares.llm.stripprefix.forceslash=false"
- "traefik.http.routers.llm.middlewares=llm"
networks:
jan_community:
ipv4_address: 172.20.0.18
sd-downloader:
build:
context: ./jan-inference/sd/
dockerfile: compile.Dockerfile
command: /bin/sh -c "if [ ! -f /models/*.bin ]; then python /sd.cpp/sd_cpp/models/convert.py --out_type q4_0 --out_file /models/${SD_MODEL_FILE}.q4_0.bin /models/${SD_MODEL_FILE}; fi"
volumes:
- ./jan-inference/sd/models:/models
networks:
jan_community:
ipv4_address: 172.20.0.19
sd:
build:
context: ./jan-inference/sd/
dockerfile: inference.Dockerfile
volumes:
- ./jan-inference/sd/models:/models/
command: /bin/bash -c "python -m uvicorn main:app --proxy-headers --host 0.0.0.0 --port 8000"
environment:
S3_ENDPOINT_URL: ${S3_ENDPOINT_URL}
S3_PUBLIC_ENDPOINT_URL: ${S3_PUBLIC_ENDPOINT_URL}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
MODEL_NAME: ${SD_MODEL_FILE}.q4_0.bin
MODEL_DIR: /models
OUTPUT_DIR: /tmp
SD_PATH: /sd
PYTHONUNBUFFERED: 1
ports:
- 8000:8000
restart: on-failure
depends_on:
sd-downloader:
condition: service_completed_successfully
labels:
- "traefik.enable=true"
- "traefik.http.routers.sd.entrypoints=jan"
- "traefik.http.routers.sd.rule=(PathPrefix(`/sd`))"
- "traefik.http.middlewares.sd.stripprefix.prefixes=/sd"
- "traefik.http.middlewares.sd.stripprefix.forceslash=false"
- "traefik.http.routers.sd.middlewares=sd"
networks:
jan_community:
ipv4_address: 172.20.0.21
minio:
image: minio/minio
ports:
- 9000:9000
- 9001
volumes:
- ./minio/data:/export
- ./minio/config:/root/.minio
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${S3_SECRET_ACCESS_KEY}
command: server /export --console-address ":9001"
labels:
- "traefik.enable=true"
- "traefik.http.routers.minio.entrypoints=jan"
- "traefik.http.routers.minio.rule=(PathPrefix(`/minio`))"
- "traefik.http.middlewares.minio.stripprefix.prefixes=/minio"
- "traefik.http.middlewares.minio.stripprefix.forceslash=false"
- "traefik.http.routers.minio.middlewares=minio"
networks:
jan_community:
ipv4_address: 172.20.0.23
createbuckets:
image: minio/mc
depends_on:
- minio
environment:
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY}
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 ${S3_ACCESS_KEY_ID} ${S3_SECRET_ACCESS_KEY};
/usr/bin/mc rm -r --force myminio/${S3_BUCKET_NAME};
/usr/bin/mc mb myminio/${S3_BUCKET_NAME};
/usr/bin/mc anonymous set public myminio/${S3_BUCKET_NAME};
exit 0;
"
networks:
jan_community:
traefik:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--log.level=debug"
- "--entrypoints.jan.address=:1337"
ports:
- "1337:1337"
- "9090:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
jan_community:
ipv4_address: 172.20.0.22
networks:
jan_community:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16