-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
86 lines (81 loc) · 1.68 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
networks:
telehealth-network:
driver: bridge
services:
redis:
image: redis:7
container_name: redis
# ports:
# - "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- telehealth-network
db:
image: postgres
restart: always
container_name: telehealth_db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_PASSWORD: telehealth_test!!11
POSTGRES_DB: telehealth_test
# ports:
# - 5432:5432
networks:
- telehealth-network
server1:
container_name: server1
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
build:
context: .
dockerfile: Dockerfile
command:
- /bin/sh
- -c
- |
npx prisma migrate dev
npm run start:prod
networks:
- telehealth-network
server2:
container_name: server2
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
build:
context: .
dockerfile: Dockerfile
command:
- /bin/sh
- -c
- |
npx prisma migrate dev
npm run start:prod
networks:
- telehealth-network
haproxy:
image: haproxy:latest
container_name: haproxy
depends_on:
- server1
- server2
ports:
- "8080:80"
volumes:
- ./haproxy/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
- ./haproxy/cors.lua:/usr/local/etc/haproxy/cors.lua:ro
networks:
- telehealth-network