-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
88 lines (84 loc) · 2.16 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
version: "3.9"
services:
ais3uson:
image: ais3uson
pull_policy: build # never
build:
context: ./
dockerfile: ./Dockerfile
deploy:
replicas: 1
ports:
- "48080:48080"
- "48081:48081" # useful for testing, required --debug-portoption
restart: always
command: --mysql-host aismysql --conf-dir "/run/secrets" --debug-port
links:
- aismysql
networks:
frontend:
backend:
secrets:
- mysql-web-worker-password
- cert.pem
- privkey.pem
aismysql:
image: mysql:8.0.16
deploy:
replicas: 1
placement: # main db should run only once and always on the same node
constraints: [node.role == manager]
volumes:
- ais-mysql-data:/var/lib/mysql
- ../sql/mysql:/docker-entrypoint-initdb.d
secrets:
- mysql-root-password
# NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
# (this is just an example, not intended to be a production configuration)
# command: --default-authentication-plugin=mysql_native_password
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_DATABASE: kcson
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/mysql-root-password
ports:
- "3307:3306"
networks:
backend:
adminer: # OPTIONAL
deploy:
replicas: 1
image: adminer
restart: always
ports:
- 8080:8080
networks:
frontend:
backend:
# backup: # TODO
# image: backup-service
# volumes:
# - data-volume:/var/lib/backup/data
volumes:
ais-mysql-data:
# certificate:
# secret:
# secretName: ais3uson-https-cert
secrets:
cert.pem:
file: secrets/cert.pem
privkey.pem:
file: secrets/privkey.pem
mysql-web-worker-password:
file: secrets/mysql-web-worker-password
mysql-root-password:
file: secrets/mysql-root-password
networks:
frontend:
backend:
#healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 1m30s
# timeout: 10s
# retries: 3
# start_period: 40s