-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-multi-db.yml
84 lines (78 loc) · 2.03 KB
/
docker-compose-multi-db.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
version: '3.7'
networks:
internal:
ipam:
config:
- subnet: 172.30.0.0/24
x-mariadb-defaults: &mariadb-defaults
# pin to 10.4 for compatibility
image: mariadb:10.4
restart: always
labels:
- com.centurylinklabs.watchtower.enable=true
environment:
MYSQL_ROOT_PASSWORD: CHANGEME
x-openenventory-defaults: &open_enventory-defaults
restart: always
build:
context: .
dockerfile: docker/openenventory
volumes:
- ./customization/:/var/www/html/customization/
services:
# first instance
database_1:
<<: *mariadb-defaults
networks:
internal:
ipv4_address: 172.30.0.21
ports:
- 127.0.0.1:33301:3306
# keep in mind to check volume for /var/lib/mysql
#volumes:
# - ./mariadb/database_1:/var/lib/mysql:rw
openenventory_1:
<<: *open_enventory-defaults
environment:
# make the name of the database server available via environment
# variable
DB_SERVER: database_1
# hide the database name input field from the user
SINGLE_DB: 1
ports:
- 127.0.0.1:8888:80
# pin the IP of the container to
# retain MySQL Grants which are based on the containers IP
networks:
internal:
ipv4_address: 172.30.0.22
depends_on:
- database_1
# another instance
database_2:
<<: *mariadb-defaults
networks:
internal:
ipv4_address: 172.30.0.31
ports:
- 127.0.0.2:33302:3306
# keep in mind to check volume for /var/lib/mysql
#volumes:
# - ./mariadb/database_2:/var/lib/mysql:rw
openenventory_2:
<<: *open_enventory-defaults
environment:
# make the name of the database server available via environment
# variable
DB_SERVER: database_2
# hide the database name input field from the user
SINGLE_DB: 1
ports:
- 127.0.0.1:8889:80
# pin the IP of the container to
# retain MySQL Grants which are based on the containers IP
networks:
internal:
ipv4_address: 172.30.0.32
depends_on:
- database_2