generated from course-files/BBT3104-Lab1of6-DatabaseTransactions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocker-Compose.yaml
134 lines (128 loc) · 3.83 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
services:
apache-php:
image: customized-apache-httpd-plus-php:1.0
hostname: apache-2.4-php-8.2
container_name: apache-2.4-php-8.2
restart: always
ports:
- 8002:80
volumes:
# To store the web-related files in a persistent volume (directory/folder) in the host
- apache-httpd-www:/var/www/html/
# To store the PHP configuration file in the host
- php-config:/usr/local/etc/php/
environment:
PHP_DISPLAY_ERRORS: 1
PHP_DISPLAY_STARTUP_ERRORS: 1
command: >
/bin/bash -c "
apache2-foreground
"
mysql-8.0.40-debian:
image: customized-mysql:1.0
hostname: mysql-8.0.40-debian
container_name: mysql-8.0.40-debian
restart: always
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
"
postgres-17.2:
image: postgres:17.2
hostname: postgres-17.2
container_name: postgres-17.2
restart: always
shm_size: 1g
ports:
- 5433:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 5trathm0re
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
# To store the server's configuration files (postgresql.conf and pg_hba.conf) in the host
- postgres-config:/etc/postgresql/
# To store the server's log files in the host
- postgres-log:/var/log/postgresql/
# To store the server's data persistently in the host
- postgres-data:/var/lib/postgresql/data
# To run the SQL scripts used to create the required databases
- postgres-init:/docker-entrypoint-initdb.d/
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
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/
postgres-config:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/postgresql/etc-postgresql/
postgres-log:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/postgresql/var-log-postgresql/
postgres-data:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/postgresql/var-lib-postgresql-data/
postgres-init:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/postgresql/init-scripts/
apache-httpd-www:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/apache/var-www-html/
php-config:
driver: local
driver_opts:
type: none
o: bind
device: ./container-volumes/apache/etc-php/