-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
85 lines (81 loc) · 2.37 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
version: "3.9"
x-common-fastapi-healthcheck: &common-fastapi-healthcheck
test:
[
"CMD-SHELL",
"wget --quiet --tries=1 --spider http://localhost:8000/ || exit 1",
]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
x-common-express-healthcheck: &common-express-healthcheck
test: ["CMD", "curl", "-f", "http://localhost:3010/health"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
x-common-mongo-healthcheck: &common-mongo-healthcheck
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
x-common-nginx-healthcheck: &common-nginx-healthcheck
test: ["CMD-SHELL", "wget -O /dev/null http://localhost || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
x-common-restart-policy: &common-restart-policy "no"
x-mongo-image: &mongo-image mongo:latest
services:
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: digital_eye_nginx_server
ports:
- "80:80"
#- "443:443"
depends_on:
dashboard-service:
condition: service_healthy
volumes:
#- nginx:/etc/letsencrypt # Docker managed volume (see list at the bottom)
- ./nginx/conf:/etc/nginx/conf.d
#- /etc/letsencrypt:/etc/letsencrypt
#- ./nginx/user_conf.d:/etc/nginx/user_conf.d
healthcheck: *common-nginx-healthcheck
restart: *common-restart-policy
mongo-db:
image: *mongo-image
container_name: digital_eye_mongo_db
volumes:
- ./data/mongo:/data/db
env_file:
- .env
ports:
- 27017:27017
healthcheck: *common-mongo-healthcheck
restart: *common-restart-policy
dashboard-service:
build:
context: .
dockerfile: dashboard-service/Dockerfile
target: dashboard-service
container_name: digital_eye_dashboard_service
volumes:
- ./dashboard-service:/home/issm/app/dashboard-service/
- ./issm-api-common:/home/issm/app/issm-api-common/
- ./issm-common-services:/home/issm/app/issm-common-services/
- ./issm-common-database-setup:/home/issm/app/issm-common-database-setup/
healthcheck: *common-fastapi-healthcheck
ports:
- "${DASHBOARD_SERVICE_PORT}:8000"
depends_on:
mongo-db:
condition: service_healthy
env_file:
- .env
restart: *common-restart-policy