-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
126 lines (116 loc) · 3.09 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
version: '3.9'
services:
redis-master:
image: 'bitnami/redis:latest'
restart: always
sysctls:
net.core.somaxconn: 65365
environment:
- REDIS_REPLICATION_MODE=master
- REDIS_PASSWORD=secret
networks:
- prod
redis-replica:
image: 'bitnami/redis:latest'
restart: always
sysctls:
net.core.somaxconn: 65365
depends_on:
- redis-master
environment:
- REDIS_REPLICATION_MODE=slave
- REDIS_MASTER_HOST=redis-master
- REDIS_MASTER_PORT_NUMBER=6379
- REDIS_MASTER_PASSWORD=secret
- REDIS_PASSWORD=secret
networks:
- prod
scale: 3
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
networks:
- prod
write-api:
build:
context: src
dockerfile: ../dockerfile.writeapi
restart: always
depends_on:
- mongo
- centrifugo
- redis-master
- redis-replica
environment:
ASPNETCORE_ENVIRONMENT: Prod
networks:
- prod
scale: 1
read-api:
build:
context: src
dockerfile: ../dockerfile.readapi
restart: always
depends_on:
- mongo
- centrifugo
- redis-master
- redis-replica
environment:
ASPNETCORE_ENVIRONMENT: Prod
networks:
- prod
scale: 1
mongo-express:
image: mongo-express
restart: always
ports:
- 127.0.0.1:8081:8081
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=root
- ME_CONFIG_MONGODB_ADMINPASSWORD=secret
- ME_CONFIG_MONGODB_URL=mongodb://root:secret@mongo:27017/
networks:
- prod
nginx:
image: nginx:alpine
restart: always
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl/nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt:ro
- ./nginx/ssl/nginx-selfsigned.key:/etc/ssl/private/nginx-selfsigned.key:ro
- /var/log/nginx:/var/log/nginx
depends_on:
- write-api
- read-api
- centrifugo
- frontend
ports:
- 443:443
- 443:443/udp
networks:
- prod
centrifugo:
image: centrifugo/centrifugo:v4
restart: always
command: centrifugo --admin --config=/var/centrifugo/config.json
ulimits:
nofile:
soft: 65535
hard: 65535
volumes:
- ./centrifugo/config.json:/var/centrifugo/config.json:ro
networks:
- prod
frontend:
build:
context: frontend
dockerfile: dockerfile
restart: always
networks:
- prod
networks:
prod: