-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
60 lines (60 loc) · 1.43 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
services:
api:
build:
context: ./api/
dockerfile: Dockerfile.dev
ports:
- "${PORT_API:-3002}:${PORT_API:-3002}"
environment:
- PORT=${PORT_API:-3002}
- DB_URL=mongodb://database:${PORT_DB:-27017}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- CHAT_LANGUAGE=${CHAT_LANGUAGE}
volumes:
- ./api/:/app
- /app/node_modules
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${PORT_API:-3002}/health"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
database:
condition: service_healthy
database:
image: mongo
ports:
- "${PORT_DB:-27017}:27017"
volumes:
- mongo-data:/data/db
- ./api/mongo/init-scripts:/docker-entrypoint-initdb.d
healthcheck:
test:
[
"CMD",
"mongosh",
"--quiet",
"127.0.0.1/subventions",
"--eval",
"'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'",
]
interval: 5s
timeout: 5s
retries: 5
interface:
build:
context: ./interface/
dockerfile: Dockerfile.dev
ports:
- "${PORT_INTERFACE:-3000}:3000"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:${PORT_API:-3002}
- NEXT_PUBLIC_DEBUG_MODE=${DEBUG_MODE}
volumes:
- ./interface/:/app
- /app/node_modules
depends_on:
api:
condition: service_healthy
volumes:
mongo-data: