-
Notifications
You must be signed in to change notification settings - Fork 143
/
docker-compose.yaml
87 lines (82 loc) · 2.12 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"
# 声明一个名为network的networks,subnet为network的子网地址,默认网关是177.7.0.1
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
services:
mysql:
image: mysql:8.0.21 # 如果您是 arm64 架构:如 MacOS 的 M1,请修改镜像为 image: mysql/mysql-server:8.0.21
container_name: gshark-mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: "always"
ports:
- "13306:3306" # host物理直接映射端口为13306
environment:
MYSQL_DATABASE:
MYSQL_ROOT_PASSWORD: 'madneal'
MYSQL_USER: 'gshark'
MYSQL_PASSWORD: 'gshark'
volumes:
- ./mysql:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 2s
retries: 10
networks:
network:
ipv4_address: 177.7.0.13
web:
build:
context: ./web
dockerfile: ./Dockerfile
container_name: gshark-web
restart: "always"
ports:
- '8080:8080'
depends_on:
- server
command: [ 'nginx', '-g', 'daemon off;' ]
networks:
network:
ipv4_address: 177.7.0.11
server:
build:
context: ./server
dockerfile: deploy/serve/Dockerfile
environment:
- GSHARK_CONFIG=config.docker.yaml
container_name: gshark-server
volumes:
- ./server/config.docker.yaml:/go/src/github.com/madneal/gshark/server/config.docker.yaml
restart: "always"
ports:
- '8888:8888'
depends_on:
mysql:
condition: service_healthy
links:
- mysql
networks:
network:
ipv4_address: 177.7.0.12
scan:
build:
context: ./server
dockerfile: deploy/scan/Dockerfile
environment:
- GSHARK_CONFIG=config.docker.yaml
container_name: gshark-scanner
volumes:
- ./server/config.docker.yaml:/go/src/github.com/madneal/gshark/server/config.docker.yaml
restart: "no"
depends_on:
mysql:
condition: service_healthy
links:
- mysql
networks:
network:
ipv4_address: 177.7.0.14