Repository navigation
Expand file tree
/
Copy pathcompose.yml
More file actions
187 lines (179 loc) · 4.52 KB
/
Copy pathcompose.yml
File metadata and controls
187 lines (179 loc) · 4.52 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
services:
# One-shot DB migration + metadata ingestion. Runs manually, not with the stack.
# docker compose --profile ingest run --rm file-ingest
file-ingest:
profiles: ["ingest"]
image: mcr.microsoft.com/dotnet/sdk:8.0
container_name: maple2-file-ingest
working_dir: /app/Maple2.File.Ingest
entrypoint:
- /bin/sh
- -c
- |
export PATH="$PATH:/root/.dotnet/tools"
dotnet tool update --global dotnet-ef --version 7.0.20 2>/dev/null || dotnet tool install --global dotnet-ef --version 7.0.20
dotnet restore /app/Maple2.Server.World/Maple2.Server.World.csproj
dotnet run
depends_on:
mysql:
condition: service_healthy
env_file:
- .env
environment:
DB_IP: mysql
MS2_DATA_FOLDER: /ClientData
volumes:
- .:/app
- ${MS2_DOCKER_DATA_FOLDER:-./Data}:/ClientData
- dotnet_tools:/root/.dotnet/tools
login:
build:
context: .
dockerfile: ./Maple2.Server.Login/Dockerfile
container_name: maple2-login
image: maple2/login
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
world:
condition: service_healthy
ports:
- 20001:20001
env_file:
- .env
environment:
DB_IP: mysql
GRPC_WORLD_IP: world
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/21000"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
world:
build:
context: .
dockerfile: ./Maple2.Server.World/Dockerfile
container_name: maple2-world
image: maple2/world
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- 21001:21001
env_file:
- .env
environment:
DB_IP: mysql
GRPC_LOGIN_IP: login
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/21001"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
game-ch1:
build:
context: .
dockerfile: ./Maple2.Server.Game/Dockerfile
image: maple2/game
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
world:
condition: service_healthy
# Ports are dynamically assigned from world server, sadly we can't dynamically expose them here. So we have to hardcode them.
ports:
- 20003:20003
- 21003:21003
env_file:
- .env
environment:
DB_IP: mysql
GRPC_GAME_IP: game-ch1
GRPC_WORLD_IP: world
game-ch2:
build:
context: .
dockerfile: ./Maple2.Server.Game/Dockerfile
image: maple2/game
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
world:
condition: service_healthy
# Ports are dynamically assigned from world server, sadly we can't dynamically expose them here. So we have to hardcode them.
ports:
- 20004:20004
- 21004:21004
env_file:
- .env
environment:
DB_IP: mysql
GRPC_GAME_IP: game-ch2
GRPC_WORLD_IP: world
# Channel 0 is instanced content only
game-ch0:
build:
context: .
dockerfile: ./Maple2.Server.Game/Dockerfile
image: maple2/game
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
world:
condition: service_healthy
# Ports are dynamically assigned from world server, sadly we can't dynamically expose them here. So we have to hardcode them.
ports:
- 20002:20002
- 21002:21002
env_file:
- .env
environment:
DB_IP: mysql
GRPC_GAME_IP: game-ch0
GRPC_WORLD_IP: world
INSTANCED_CONTENT: true
web:
build:
context: .
dockerfile: ./Maple2.Server.Web/Dockerfile
container_name: maple2-web
image: maple2/web
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- "${WEB_PORT:-4000}:${WEB_PORT:-4000}"
env_file:
- .env
environment:
DB_IP: mysql
mysql:
image: mysql:8.0
restart: unless-stopped
container_name: maple2-db
env_file:
- .env
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-maplestory}
MYSQL_ROOT_HOST: "%"
volumes:
- mysql:/var/lib/mysql
ports:
- 3306:3306
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$${MYSQL_ROOT_PASSWORD} --silent"]
interval: 5s
timeout: 5s
retries: 30
start_period: 30s
volumes:
dotnet_tools:
mysql: