-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
172 lines (165 loc) · 3.89 KB
/
docker-compose.yml
File metadata and controls
172 lines (165 loc) · 3.89 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
services:
# Monolith mode
monolith:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: monolith
environment:
- MICROSERVICE=0
- AUTH_URL=localhost:50051
- WORLD_GEN_URL=localhost:50051
- INITIATOR_URL=localhost:50051
- GAME_ENGINE_URL=localhost:50051
- MUSIC_URL=localhost:50051
- SCORE_URL=localhost:50051
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50051:50051/tcp"
- "4433:4433/tcp"
- "4433:4433/udp"
volumes:
- ./backend/score.json:/app/score.json
- ./backend/users.json:/app/users.json
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
profiles:
- monolith
# Microservices mode - single host
auth:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: auth
environment:
- MICROSERVICE=1
- AUTH_LISTEN_ADDR=:50051
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50051:50051"
volumes:
- ./backend/users.json:/app/users.json
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
profiles:
- microservices
worldgen:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: worldgen
environment:
- MICROSERVICE=1
- AUTH_LISTEN_ADDR=:50052
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50052:50052"
profiles:
- microservices
engine:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: engine
environment:
- MICROSERVICE=1
- WORLD_GEN_URL=worldgen:50052
- SCORE_URL=score:50056
- MUSIC_URL=music:50055
- AUTH_LISTEN_ADDR=:50053
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50053:50053/tcp"
- "4433:4433/tcp"
- "4433:4433/udp"
volumes:
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
depends_on:
- worldgen
profiles:
- microservices
initiator:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: initiator
environment:
- MICROSERVICE=1
- AUTH_LISTEN_ADDR=:50054
- WORLD_GEN_URL=worldgen:50052
- GAME_ENGINE_URL=engine:50053
- INITIATOR_URL=initiator:50054
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50054:50054"
volumes:
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
depends_on:
- engine
- worldgen
profiles:
- microservices
music:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: music
environment:
- MICROSERVICE=1
- AUTH_LISTEN_ADDR=:50055
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50055:50055/tcp"
- "4434:4433/tcp"
- "4434:4433/udp"
volumes:
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
profiles:
- microservices
score:
build:
context: ./
dockerfile: backend/Dockerfile
args:
SERVICE: score
environment:
- MICROSERVICE=1
- AUTH_LISTEN_ADDR=:50056
- AUTH_CERT_FILE=/app/cert.pem
- AUTH_KEY_FILE=/app/key.pem
ports:
- "50056:50056"
volumes:
- ./backend/score.json:/app/score.json
- ./certs/cert.pem:/app/cert.pem
- ./certs/key.pem:/app/key.pem
profiles:
- microservices
client:
build:
context: ./
dockerfile: flap-client/Dockerfile
args:
DEPLOYMENT_MODE: ${DEPLOYMENT_MODE:-monolith}
ports:
- "8080:8080"
environment:
- NODE_ENV=production
profiles:
- monolith
- microservices