-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
347 lines (336 loc) · 9.77 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
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
services:
mariadb:
image: mariadb:lts
container_name: flyingfish_db
environment:
MARIADB_AUTO_UPGRADE: '1'
MARIADB_INITDB_SKIP_TZINFO: '1'
MYSQL_ROOT_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: "${MARIADB_DATABASE}"
healthcheck:
test: [ "CMD", "mariadb", "-u${MARIADB_ROOT_USERNAME}", "-p${MARIADB_ROOT_PASSWORD}", "-e", "use ${MARIADB_DATABASE}" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
volumes:
- flyingfishDbData:/var/lib/mysql
ports:
- "127.0.0.1:3306:3306"
networks:
flyingfishNet:
ipv4_address: 10.103.0.2
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
influxdb:
image: influxdb:latest
container_name: flyingfish_influxdb
volumes:
- flyingfishInfluxdbData:/var/lib/influxdb2
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=${INFLUXDB_USERNAME}
- DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUXDB_PASSWORD}
- DOCKER_INFLUXDB_INIT_ORG=${INFLUXDB_ORG}
- DOCKER_INFLUXDB_INIT_BUCKET=${INFLUXDB_BUCKET}
- DOCKER_INFLUXDB_INIT_RETENTION=${INFLUXDB_RETENTION}
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUXDB_ADMIN_TOKEN}
- INFLUXDB_STORAGE_CACHE_MAX_MEMORY_SIZE=52428800
- INFLUXDB_STORAGE_CACHE_SNAPSHOT_MEMORY_SIZE=26214400
- INFLUXDB_STORAGE_CACHE_SNAPSHOT_WRITE_COLD_DURATION=10s
- INFLUXDB_STORAGE_WAL_FSYNC_DELAY=1s
- INFLUXDB_STORAGE_INDEX_VERSION=tsi1
ports:
- "127.0.0.1:8086:8086"
networks:
flyingfishNet:
ipv4_address: 10.103.0.5
healthcheck:
test: "curl -f http://localhost:8086/ping"
interval: 5s
timeout: 10s
retries: 5
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
redis:
image: redis:7.2-alpine
container_name: flyingfish_redis
volumes:
- flyingfishRedisData:/data
ports:
- '127.0.0.1:6379:6379'
command: ["redis-server", "--save", "${REDIS_SAVE}", "--loglevel", "${REDIS_LOGLEVEL}", "--maxmemory", "${REDIS_MAX_MEMORY}", "--maxmemory-policy", "allkeys-lru", "--requirepass", "${REDIS_REQUIREPASS}"]
networks:
flyingfishNet:
ipv4_address: 10.103.0.7
healthcheck:
test: [ "CMD-SHELL", "redis-cli -a ${REDIS_REQUIREPASS} ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
flyingfish:
image: flyingfish:v1.2
build:
context: ./
dockerfile: Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY}
container_name: flyingfish_service
volumes:
- ./nginx:/opt/flyingfish/nginx:rw
- flyingfishLetsencrypt:/etc/letsencrypt:rw
- flyingfish:/var/lib/flyingfish:rw
- ./backend/dist:/opt/flyingfish/backend/dist
- ./backend/node_modules:/opt/flyingfish/backend/node_modules
- ./backend/package.json:/opt/flyingfish/backend/package.json
- ./frontend/assets:/opt/flyingfish/frontend/assets
- ./frontend/dist:/opt/flyingfish/frontend/dist
- ./frontend/src:/opt/flyingfish/frontend/src
- ./node_modules:/opt/flyingfish/node_modules
- ./package.json:/opt/flyingfish/package.json
environment:
FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
FLYINGFISH_DB_INFLUX_URL: "${INFLUXDB_URL}"
FLYINGFISH_DB_INFLUX_TOKEN: "${INFLUXDB_ADMIN_TOKEN}"
FLYINGFISH_DB_INFLUX_ORG: "${INFLUXDB_ORG}"
FLYINGFISH_DB_INFLUX_BUCKET: "${INFLUXDB_BUCKET}"
FLYINGFISH_HTTPSERVER_PORT: "${HTTPSERVER_PORT}"
FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
FLYINGFISH_HIMHIP_USE: "${HIMHIP_USE}"
FLYINGFISH_HIMHIP_SECRET: "${HIMHIP_SECRET}"
FLYINGFISH_DYNDNSSERVER_ENABLE: "${DYNDNSSERVER_ENABLE}"
FLYINGFISH_DB_REDIS_PASSWORD: "${REDIS_REQUIREPASS}"
ports:
- "443:443"
- "80:80"
- "5333:53/udp"
- "5333:53/tcp"
- "${HTTPSERVER_PORT}:${HTTPSERVER_PORT}"
- "1900:1900"
- "10901:10901"
- "9229:9229"
networks:
flyingfishNet:
ipv4_address: 10.103.0.3
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
influxdb:
condition: service_healthy
command:
- node
- "--inspect-brk=0.0.0.0:9229"
- "backend/dist/main.js"
- "--envargs=1"
himhip:
image: flyingfish_himip:v1.0
build:
context: ./
dockerfile: ./himhip/Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY}
container_name: flyingfish_himhip
environment:
FLYINGFISH_SECRET: "${HIMHIP_SECRET}"
FLYINGFISH_SERVER_PORT: "${HTTPSERVER_PORT}"
FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
FLYINGFISH_DB_REDIS_PASSWORD: "${REDIS_REQUIREPASS}"
network_mode: host
cap_add:
- ALL
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
depends_on:
redis:
condition: service_healthy
flyingfish:
condition: service_started
# iptable:
# image: flyingfish_iptable:v1.0
# build:
# context: ./iptable/
# container_name: flyingfish_iptable
# volumes:
# - ./iptable/dist:/opt/app/dist
# - ./iptable/node_modules:/opt/app/node_modules
# - ./iptable/package.json:/opt/app/package.json
# command:
# - node
# - "--inspect-brk=0.0.0.0:9229"
# - "dist/main.js"
# - "--reciverurl=https://10.103.0.3:3000/iptable/list"
# - "--secret=${IPTABLE_SECURE_TOKEN}"
# network_mode: host
# cap_add:
# - ALL
# logging:
# driver: "json-file"
# options:
# max-size: "500k"
# max-file: "50"
# depends_on:
# - flyingfish
sshremote:
image: flyingfish_ssh:v1.0
build:
context: ./
dockerfile: ./sshserver/Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY}
container_name: flyingfish_ssh
volumes:
- flyingfishSsh:/opt/flyingfish/ssh:rw
- ./sshserver/dist:/opt/flyingfish/sshserver/dist
- ./sshserver/node_modules:/opt/flyingfish/sshserver/node_modules
- ./sshserver/package.json:/opt/flyingfish/sshserver/package.json
- ./node_modules:/opt/flyingfish/node_modules
- ./package.json:/opt/flyingfish/package.json
environment:
FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
FLYINGFISH_HTTPSERVER_PORT: "${HTTPSERVER_PORT}"
FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
ports:
- "2222:22"
networks:
flyingfishNet:
ipv4_address: 10.103.0.4
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
flyingfish:
condition: service_started
ddnsserver:
image: flyingfish_ddns:v1.0
build:
context: ./
dockerfile: ./ddnsserver/Dockerfile
args:
NPM_REGISTRY: ${NPM_REGISTRY}
container_name: flyingfish_ddns
volumes:
- ./ddnsserver/dist:/opt/flyingfish/ddnsserver/dist
- ./ddnsserver/node_modules:/opt/flyingfish/ddnsserver/node_modules
- ./ddnsserver/package.json:/opt/flyingfish/ddnsserver/package.json
- ./node_modules:/opt/flyingfish/node_modules
- ./package.json:/opt/flyingfish/package.json
environment:
FLYINGFISH_DB_MYSQL_USERNAME: "${MARIADB_ROOT_USERNAME}"
FLYINGFISH_DB_MYSQL_PASSWORD: "${MARIADB_ROOT_PASSWORD}"
FLYINGFISH_DB_MYSQL_DATABASE: "${MARIADB_DATABASE}"
FLYINGFISH_LOGGING_LEVEL: "${LOGGING_LEVEL}"
# ports:
# - "9229:9229"
networks:
flyingfishNet:
ipv4_address: 10.103.0.6
logging:
driver: "json-file"
options:
max-size: "500k"
max-file: "50"
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
flyingfish:
condition: service_started
# command:
# - node
# - "--inspect-brk=0.0.0.0:9229"
# - "ddnsserver/dist/main.js"
# - "--envargs=1"
# vpnserver:
# image: flyingfish_vpn:v1.2
# build:
# context: ./
# dockerfile: ./vpn/Dockerfile
# container_name: flyingfish_vpn
# volumes:
# - ./vpn/dist:/opt/app/dist
# privileged: true
# network_mode: host
# logging:
# driver: "json-file"
# options:
# max-size: "500k"
# max-file: "50"
# depends_on:
# mariadb:
# condition: service_healthy
# redis:
# condition: service_healthy
# flyingfish:
# condition: service_started
# onionhat:
# image: flyingfish_onionhat:v1.0
# build:
# context: ./onionhat/
# container_name: flyingfish_onionhat
# volumes:
# - ./config.json:/opt/app/config.json
# ports:
# - "9050:9050"
# networks:
# flyingfishNet:
# ipv4_address: 10.103.0.5
# logging:
# driver: "json-file"
# options:
# max-size: "500k"
# max-file: "50"
# depends_on:
# - mariadb
# - flyingfish
volumes:
flyingfishDbData:
driver: local
flyingfishInfluxdbData:
driver: local
flyingfish:
driver: local
flyingfishLetsencrypt:
driver: local
flyingfishSsh:
driver: local
flyingfishRedisData:
driver: local
networks:
flyingfishNet:
driver: bridge
ipam:
config:
- subnet: 10.103.0.0/16