-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
260 lines (248 loc) · 6.71 KB
/
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
services:
db-test.liexp.dev:
image: postgres:17
ports:
- "127.0.0.1:9432:5432"
environment:
POSTGRES_USER: liexp
POSTGRES_PASSWORD: liexp-password
POSTGRES_DB: liexp-test
volumes:
- ./services/api/db/psql-create-database.sh:/docker-entrypoint-initdb.d/psql-create-database.sh
db.liexp.dev:
image: postgres:17
ports:
- "127.0.0.1:8432:5432"
environment:
POSTGRES_USER: liexp
POSTGRES_PASSWORD: liexp-password
POSTGRES_DB: liexp
VIRTUAL_HOST: db.liexp.dev
VIRTUAL_PORT: 5432
restart: on-failure
volumes:
- ./services/api/db/dump:/docker-entrypoint-initdb.d
- db-data:/var/lib/postgresql/data
networks:
- reverseproxy
fra1.space.liexp.dev:
image: minio/minio:latest
command: server --console-address ":9001" /data
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
environment:
MINIO_ROOT_USER: space-access-key-id
MINIO_ROOT_PASSWORD: space-access-key-secret-id
VIRTUAL_HOST: fra1.space.liexp.dev
VIRTUAL_PORT: 9000
volumes:
- space-data:/data
restart: on-failure
networks:
- reverseproxy
# healthcheck:
# test: ["CMD", "curl", "-f", "http://fra1.space.liexp.dev:9000/minio/health/live"]
# interval: 10s
# timeout: 20s
# retries: 3
redis.liexp.dev:
restart: always
image: "redis:7.2"
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis-data:/data
networks:
- reverseproxy
api-base:
build:
context: .
target: dev
dockerfile: api.Dockerfile
env_file:
- ./services/api/.env
- ./services/api/.env.local
environment:
NODE_ENV: development
DEBUG: "@liexp*"
DB_HOST: db.liexp.dev
DB_PORT: 5432
SERVER_PORT: 80
depends_on:
- db.liexp.dev
- fra1.space.liexp.dev
- redis.liexp.dev
volumes:
- api-node-modules:/usr/src/app/node_modules
- ./packages/@liexp:/usr/src/app/packages/@liexp:ro
- ./services/api:/usr/src/app/services/api:cached
- ./services/worker/config:/usr/src/app/services/api/config:ro
working_dir: /usr/src/app/services/api
api.liexp.dev:
extends: api-base
depends_on:
- db.liexp.dev
- fra1.space.liexp.dev
healthcheck:
test: ["CMD", "curl", "-f", "http://api.liexp.dev/v1/healthcheck"]
interval: 10s
timeout: 20s
retries: 10
start_period: 15s
command: pnpm docker:dev
restart: always
mem_limit: 1G
networks:
- reverseproxy
worker.liexp.dev:
build:
context: .
target: dev
dockerfile: worker.Dockerfile
env_file:
- ./services/worker/.env
- ./services/worker/.env.local
environment:
TG_BOT_POLLING: "true"
NODE_ENV: development
DEBUG: "@liexp*"
DB_HOST: db.liexp.dev
DB_PORT: 5432
command: pnpm docker:dev
working_dir: /usr/src/app/services/worker
depends_on:
- db.liexp.dev
- fra1.space.liexp.dev
- redis.liexp.dev
volumes:
- worker-node-modules:/usr/src/app/node_modules
- ./packages/@liexp:/usr/src/app/packages/@liexp:ro
- ./services/worker:/usr/src/app/services/worker:ro
- ./services/worker/config:/usr/src/app/services/worker/config:cached
- ./services/api/temp:/usr/src/app/services/worker/temp:cached
mem_limit: 512M
restart: always
networks:
- reverseproxy
ai-bot:
build:
context: .
target: dev
dockerfile: ai-bot.Dockerfile
command: ["node", "build/run-esbuild.js"]
env_file:
- ./services/ai-bot/.env.local
- ./services/ai-bot/.env
volumes:
- ./services/ai-bot/temp:/home/node/temp:rw
- ./services/ai-bot/build:/home/node/build:cached
- ./services/ai-bot/ai-bot.config.json:/home/node/ai-bot.config.json:rw
restart: always
mem_limit: 512M
depends_on:
- api.liexp.dev
networks:
- reverseproxy
liexp.dev:
build:
context: .
target: dev
dockerfile: web.Dockerfile
env_file:
- ./services/web/.env
environment:
VIRTUAL_PORT: 80
ports:
# hmr port
- "127.0.0.1:24678:24678"
volumes:
- web-node-modules:/usr/src/app/node_modules
- ./tsconfig.json:/usr/src/app/tsconfig.json
- ./packages/@liexp:/usr/src/app/packages/@liexp:ro
- ./services/web:/usr/src/app/services/web:cached
working_dir: /usr/src/app/services/web
command: pnpm docker:dev
mem_limit: 2G
tty: true
stdin_open: true
depends_on:
- api.liexp.dev
- fra1.space.liexp.dev
# healthcheck:
# test: ["CMD", "curl", "-f", "http://liexp.dev/healthcheck"]
# interval: 10s
# timeout: 20s
# retries: 10
# start_period: 15s
networks:
- reverseproxy
admin.liexp.dev:
build:
context: .
target: dev
dockerfile: adminWeb.Dockerfile
env_file:
- ./services/admin-web/.env
volumes:
- admin-node-modules:/usr/src/app/node_modules
- ./tsconfig.json:/usr/src/app/tsconfig.json
- ./packages/@liexp:/usr/src/app/packages/@liexp:ro
- ./services/admin-web:/usr/src/app/services/admin-web:cached
working_dir: /usr/src/app/services/admin-web
command: pnpm docker:dev
tty: true
depends_on:
- liexp.dev
- api.liexp.dev
- fra1.space.liexp.dev
# healthcheck:
# test: ["CMD", "curl", "-f", "http://liexp.dev:4001/"]
# interval: 10s
# timeout: 20s
# retries: 10
# start_period: 15s
networks:
- reverseproxy
localai.liexp.dev:
image: localai/localai:latest-aio-cpu
# For Intel GPUs decomment the following:
# image: localai/localai:latest-aio-gpu-intel-f32
# For AMD GPUs decomment the following:
# image: localai/localai:latest-aio-gpu-hipblas
# For Phi2 models decomment the following:
# image: localai/localai:v2.15.0-ffmpeg-core phi-2
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/readyz"]
interval: 1m
timeout: 20m
retries: 5
ports:
- "8080:8080"
tty: true
environment:
DEBUG: true
# REBUILD: true
VIRTUAL_HOST: localai.liexp.dev,localai.lies.exposed
# VIRTUAL_PORT: 8080
OPENAI_API_KEY: no-key-is-a-good-key
LOCALAI_CORS: 0
LOCALAI_CORS_ALLOW_ORIGINS: "http://admin.liexp.dev,https://alpha.lies.exposed"
volumes:
- ./models:/build/models:cached
devices:
- /dev/dri
networks:
- reverseproxy
volumes:
db-data: {}
api-node-modules: {}
worker-node-modules: {}
ai-bot-node-modules: {}
web-node-modules: {}
admin-node-modules: {}
space-data: {}
redis-data: {}
networks:
reverseproxy:
external: true