-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yaml
88 lines (78 loc) · 1.68 KB
/
docker-compose.yaml
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
version: '3'
services:
redis:
image: redis:6.2.7-alpine
restart: always
volumes:
- ./redis/data:/data
networks:
- spring-net
db:
image: postgres:15.1
restart: always
environment:
POSTGRES_PASSWORD: root_password # please change it
POSTGRES_DB: spring
volumes:
- ./postgresql/data:/var/lib/postgresql/data
networks:
- spring-net
chat-db:
image: postgres:15.1
restart: always
environment:
POSTGRES_PASSWORD: root_password # please change it
POSTGRES_DB: spring-chat
volumes:
- ./postgresql/chat-data:/var/lib/postgresql/data
networks:
- spring-net
nats:
image: nats:2.8
restart: on-failure
networks:
- spring-net
web:
image: joejoe2/spring-jwt-template:latest
restart: always
command: "bash ./wait-for-it.sh -t 0 db:5432 -- bash start.sh"
env_file:
- env/application.env
networks:
- spring-net
depends_on:
- redis
- db
- nats
chat:
image: joejoe2/spring-chat:latest
restart: always
command: "bash ./wait-for-it.sh -t 0 chat-db:5432 -- bash start.sh"
deploy:
mode: replicated
replicas: 2
env_file:
- ./env/application-chat.env
networks:
- spring-net
depends_on:
- redis
- chat-db
nginx:
image: jonasal/nginx-certbot:latest
restart: unless-stopped
env_file:
- ./nginx/nginx-certbot.env
ports:
- 80:80
- 443:443
volumes:
- ./nginx/data:/etc/letsencrypt
- ./nginx/user_conf.d:/etc/nginx/user_conf.d
networks:
- spring-net
depends_on:
- web
- chat
networks:
spring-net: