-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDocker-Compose.yaml
84 lines (80 loc) · 2.62 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
services:
postgres:
image: postgres:16.2
hostname: postgres-16.2-bbt3104-lab6
container_name: postgres-16.2-bbt3104-lab6
restart: always
shm_size: 1g
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 5trathm0re
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- ./container-volumes/postgresql/var-lib-postgresql-data:/var/lib/postgresql/data
- ./container-volumes/postgresql/postgresql.conf:/etc/postgresql/postgresql.conf
- ./container-volumes/postgresql/pg_hba.conf:/var/lib/postgresql/data/pg_hba.conf
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
pgadmin4:
image: elestio/pgadmin:REL-8_13
hostname: pgadmin-REL-8_13-bbt3104-lab6
container_name: pgadmin-REL-8_13-bbt3104-lab6
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: 5trathm0re
PGADMIN_LISTEN_PORT: 8080
ports:
- 8081:8080
volumes:
- ./container-volumes/postgresql/pgadmin/servers.json:/pgadmin4/servers.json
mysql-8.3.0:
image: mysql:8.3.0
hostname: mysql-8.3.0
container_name: mysql-8.3.0
ports:
- 3307:3306
environment:
MYSQL_ROOT_PASSWORD: 5trathm0re
volumes:
# To store the server's configuration file in the host
- mysql-config:/etc/mysql/
# To store the server's log files in the host
- mysql-log:/var/log/mysql/
# To store the server's data persistently in the host
- mysql-data:/var/lib/mysql
# To run the SQL scripts used to create the required databases
- mysql-init:/docker-entrypoint-initdb.d/
command: >
/bin/bash -c "
chmod 644 /etc/mysql/my.cnf &&
chmod 644 /etc/mysql/conf.d/docker.cnf &&
chmod 644 /etc/mysql/conf.d/mysql.cnf &&
exec docker-entrypoint.sh mysqld
"
volumes:
mysql-config:
driver: local # The volume will be stored locally on the host machine
driver_opts:
type: none # Binds to the path specified in "device" instead of creating a new directory/file on the host
o: bind # Confirms that Docker maps a directory/file on the host directly into the container
device: ./container-volumes/mysql/etc-mysql/
mysql-log:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/mysql/var-log-mysql
mysql-data:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/mysql/var-lib-mysql/
mysql-init:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/mysql/init-scripts/