-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
105 lines (99 loc) · 2.7 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: "3"
services:
primary-sql:
env_file:
- .env
container_name: main-sql
image: mysql
build:
context: ./docker/mysql
environment:
MYSQL_DATABASE: ${PRIMARY_MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${PRIMARY_MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${PRIMARY_MYSQL_USER}
MYSQL_PASSWORD: ${PRIMARY_MYSQL_PASSWORD}
ports:
- ${PRIMARY_MYSQL_PORT}:3306
volumes:
- ./docker/mysql/primary/my.conf:/etc/mysql/conf.d/my.cnf
- ./docker/mysql/primary/logs:/var/log/mysql:rw
- ./docker/mysql/dumps:/var/log/dumps:rw
- main:/var/lib/mysql
depends_on:
- replica-sql-1
- replica-sql-2
replica-sql-1:
env_file:
- .env
container_name: replica-sql-1
image: mysql
build:
context: ./docker/mysql
environment:
MYSQL_DATABASE: ${REPLICA_1_MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${REPLICA_1_MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${REPLICA_1_MYSQL_USER}
MYSQL_PASSWORD: ${REPLICA_1_MYSQL_PASSWORD}
ports:
- ${REPLICA_1_MYSQL_PORT}:3306
volumes:
- ./docker/mysql/replica-1/my.conf:/etc/mysql/conf.d/my.cnf
- ./docker/mysql/replica-1/logs:/var/log/mysql:rw
- ./docker/mysql/dumps:/var/log/dumps:rw
- replication-1:/var/lib/mysql
replica-sql-2:
env_file:
- .env
container_name: replica-sql-2
image: mysql
build:
context: ./docker/mysql
environment:
MYSQL_DATABASE: ${REPLICA_2_MYSQL_DATABASE}
MYSQL_ROOT_PASSWORD: ${REPLICA_2_MYSQL_ROOT_PASSWORD}
MYSQL_USER: ${REPLICA_2_MYSQL_USER}
MYSQL_PASSWORD: ${REPLICA_2_MYSQL_PASSWORD}
ports:
- ${REPLICA_2_MYSQL_PORT}:3306
volumes:
- ./docker/mysql/replica-2/my.conf:/etc/mysql/conf.d/my.cnf
- ./docker/mysql/replica-2/logs:/var/log/mysql:rw
- ./docker/mysql/dumps:/var/log/dumps:rw
- replication-2:/var/lib/mysql
web-server:
env_file:
- .env
container_name: web-server
image: 'web-server'
build:
context: ./docker/nginx
ports:
- ${NGINX_PORT}:80
restart: unless-stopped
depends_on:
- php-fpm
volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./docker/nginx/logs/:/var/log/nginx
- ./database:/var/www/html/database:rw
php-fpm:
env_file:
- .env
container_name: php-srv
image: php-srv
build:
context: ./docker/php
ports:
- ${PHP_PORT}:9000
restart: unless-stopped
depends_on:
- primary-sql
- replica-sql-1
- replica-sql-2
volumes:
- ./docker/php/php.ini:/usr/local/etc/php/php.ini
- ./database:/var/www/html/database:rw
volumes:
main:
replication-1:
replication-2: