-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
233 lines (221 loc) · 6.95 KB
/
docker-compose.yml
File metadata and controls
233 lines (221 loc) · 6.95 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
services:
application:
build:
context: .
dockerfile: ./.docker/app/Dockerfile
volumes:
- .:/var/www
nginx:
build:
context: ./.docker/nginx
dockerfile: Dockerfile
expose:
- "80"
ports:
- "${FORWARD_NGINX_PORT:-80}:80"
volumes:
- ./.docker/nginx/site.conf:/site.conf
volumes_from:
- application
depends_on:
- php-fpm
working_dir: /var/www
stop_grace_period: 1s
environment:
- ENV_NGINX_PHP_CONTAINER_HOST=php-fpm
- ENV_NGINX_HOST=localhost
- ENV_NGINX_PUBLIC_PATH=public
- CRONTAB_LARAVEL_SCHEDULER_ENABLED=true
networks:
- social
php-fpm:
container_name: "php-fpm"
build:
context: ./.docker/php
dockerfile: Dockerfile
volumes:
- .:/var/www
- ./.docker/php/fpm-site.conf:/usr/local/etc/php-fpm.d/900-site.conf
working_dir: /var/www
expose:
- "9000"
labels:
traefik.enable: "false"
user: '1000'
tty: true
environment:
- PHP_FPM_PM_MODE=dynamic
- PHP_FPM_PM_MAX_CHILDREN=20
networks:
- social
horizon:
container_name: "horizon"
build:
context: ./.docker/php
dockerfile: Dockerfile
volumes_from:
- php-fpm
working_dir: /var/www
volumes:
- ./.docker/horizon/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf
command: php artisan horizon
networks:
- social
redis:
image: redis:latest
container_name: "redis"
hostname: "redis"
volumes:
- ./.docker/redis:/usr/local/etc/redis
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- social
db1:
image: postgres:16.4
container_name: db1
hostname: db1
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${DB_DATABASE} -U ${DB_USERNAME}" ]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_REPLICA_MODE: master
POSTGRES_MASTER_HOST: ${DB_MASTER_HOST}
POSTGRES_REPLICA_PASSWORD: ${DB_REPLICA_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: trust
PGDATA: /data/postgres
volumes:
- volume-db1:/data/postgres
- ./.docker/postgres/db1/postgresql.extend.conf:/etc/postgresql/postgresql.extend.conf
- ./.docker/postgres/db1/pg_hba.conf:/etc/postgresql/pg_hba.conf
- ./.docker/postgres/scripts:/docker-entrypoint-initdb.d
ports:
- "${FORWARD_PORT_DB_1:-54321}:5432"
networks:
- social
db2:
image: postgres:16.4
container_name: db2
hostname: db2
restart: always
depends_on:
db1:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${DB_DATABASE} -U ${DB_USERNAME}" ]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_REPLICA_MODE: slave
POSTGRES_MASTER_HOST: ${DB_MASTER_HOST}
POSTGRES_REPLICA_PASSWORD: ${DB_REPLICA_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: trust
PGDATA: /data/postgres
volumes:
- volume-db2:/data/postgres
- ./.docker/postgres/db2/postgresql.extend.conf:/etc/postgresql/postgresql.extend.conf
- ./.docker/postgres/db2/pg_hba.conf:/etc/postgresql/pg_hba.conf
- ./.docker/postgres/scripts:/docker-entrypoint-initdb.d
ports:
- "${FORWARD_PORT_DB_2:-54322}:5432"
networks:
- social
db3:
image: postgres:16.4
container_name: db3
hostname: db3
restart: always
depends_on:
db1:
condition: service_healthy
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${DB_DATABASE} -U ${DB_USERNAME}" ]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_REPLICA_MODE: slave
POSTGRES_MASTER_HOST: ${DB_MASTER_HOST}
POSTGRES_REPLICA_PASSWORD: ${DB_REPLICA_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_HOST_AUTH_METHOD: trust
PGDATA: /data/postgres
volumes:
- volume-db3:/data/postgres
- ./.docker/postgres/db3/postgresql.extend.conf:/etc/postgresql/postgresql.extend.conf
- ./.docker/postgres/db3/pg_hba.conf:/etc/postgresql/pg_hba.conf
- ./.docker/postgres/scripts:/docker-entrypoint-initdb.d
ports:
- "${FORWARD_PORT_DB_3:-54323}:5432"
networks:
- social
postgres-testing:
image: postgres:16.4
container_name: "postgres-testing"
hostname: postgres-testing
restart: always
environment:
POSTGRES_DB: ${TESTING_DB_DATABASE}
POSTGRES_USER: ${TESTING_DB_USERNAME}
POSTGRES_PASSWORD: ${TESTING_DB_PASSWORD}
PGDATA: /data/postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${DB_DATABASE} -U ${DB_USERNAME}" ]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres-volume-testing:/data/postgres
ports:
- "${TESTING_FORWARD_DB_PORT:-5433}:5432"
networks:
- social
influxdb:
image: influxdb:2.7-alpine
container_name: influxdb
restart: unless-stopped
ports:
- 8086:8086
volumes:
- influx-data:/var/lib/influxdb2
- ./influxdb2/conf:/etc/influxdb2
networks:
- social
grafana:
image: grafana/grafana-enterprise
container_name: grafana
depends_on:
- influxdb
restart: unless-stopped
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password
- GF_INSTALL_PLUGINS=grafana-clock-panel
ports:
- '3000:3000'
volumes:
- 'grafana_storage:/var/lib/grafana'
networks:
- social
networks:
social:
driver: bridge
volumes:
volume-db1:
volume-db2:
volume-db3:
postgres-volume-testing:
driver: "local"
influx-data: {}
grafana_storage: {}