generated from moevm/nsql-clean-tempate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
73 lines (68 loc) · 1.33 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
services:
frontend:
container_name: frontend
hostname: frontend
build:
context: frontend/
dockerfile: Dockerfile
expose:
- "80"
depends_on:
- backend
networks:
- proxy
backend:
container_name: backend
hostname: backend
build:
context: backend/
dockerfile: Dockerfile
expose:
- "8081"
env_file:
- .env
depends_on:
db:
condition: service_healthy
networks:
- database
- proxy
proxy:
container_name: proxy
build:
context: proxy/
dockerfile: Dockerfile
ports:
- "8080:80"
depends_on:
- frontend
- backend
networks:
- proxy
db:
container_name: database
hostname: mongodb
image: mongodb/mongodb-community-server:7.0.0-ubi8
env_file:
- .env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_PASSWORD}
MONGO_INITDB_DATABASE: ${MONGODB_DB}
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
expose:
- "27017"
volumes:
- mongo-data:/data/db
networks:
- database
volumes:
mongo-data:
networks:
database:
proxy: