-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-mysql.yml
More file actions
63 lines (59 loc) · 2.18 KB
/
Copy pathdocker-compose-mysql.yml
File metadata and controls
63 lines (59 loc) · 2.18 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
version: '3.7'
services:
# MongoDB
cadmus-mongo:
image: mongo
container_name: cadmus-mongo
environment:
- MONGO_DATA_DIR=/data/db
- MONGO_LOG_DIR=/dev/null
command: mongod --logpath=/dev/null # --quiet
ports:
- 27017:27017
networks:
- cadmus-biblio-network
# MySql
# https://github.com/docker-library/docs/tree/master/mysql#mysql_database
# https://docs.docker.com/samples/library/mysql/#environment-variables
# https://github.com/docker-library/mysql/issues/275 (troubleshooting connection)
cadmus-mysql:
image: mysql
container_name: cadmus-mysql
# https://github.com/docker-library/mysql/issues/454
command: --default-authentication-plugin=mysql_native_password
# https://stackoverflow.com/questions/55559386/how-to-fix-mbind-operation-not-permitted-in-mysql-error-log
cap_add:
- SYS_NICE # CAP_SYS_NICE
environment:
# the password that will be set for the MySQL root superuser account
# Note: use dictionary like here rather than array (- name = value)
# or you might get MySql connection errors!
# https://stackoverflow.com/questions/37459031/connecting-to-a-docker-compose-mysql-container-denies-access-but-docker-running/37460872#37460872
MYSQL_ROOT_PASSWORD: mysql
MYSQL_ROOT_HOST: '%'
ports:
- 3306:3306
networks:
- cadmus-biblio-network
cadmus-api:
image: vedph2020/cadmus_biblio_api:4.0.0
container_name: cadmus-api
ports:
# https://stackoverflow.com/questions/48669548/why-does-aspnet-core-start-on-port-80-from-within-docker
- 60058:80
depends_on:
- cadmus-mongo
- cadmus-mysql
environment:
# for Windows use : as separator, for non Windows use __
# (see https://github.com/aspnet/Configuration/issues/469)
- CONNECTIONSTRINGS__DEFAULT=mongodb://cadmus-mongo:27017/{0}
- CONNECTIONSTRINGS__INDEX=Server=cadmus-mysql;port=3306;Database={0};Uid=root;Pwd=mysql
- SEED__INDEXDELAY=25
- SERILOG__CONNECTIONSTRING=mongodb://cadmus-mongo:27017/{0}-log
- STOCKUSERS__0__PASSWORD=P4ss-W0rd!
networks:
- cadmus-biblio-network
networks:
cadmus-biblio-network:
driver: bridge