-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-prod.yml
249 lines (210 loc) · 7.87 KB
/
docker-compose-prod.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
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
version: '3'
services:
nginx:
image: "${APP_DOCKER_STACK}-loadbalancer/php:beta-${APP_PHP_VERSION:-8.2}-unit"
pull_policy: build
environment:
AUTORUN_LARAVEL_STORAGE_LINK: false
AUTORUN_LARAVEL_MIGRATION: true
SSL_MODE: "off"
build:
context: .
dockerfile_inline: |
FROM serversideup/php:beta-${APP_PHP_VERSION:-8.2}-unit
RUN install-php-extensions gmp
RUN install-php-extensions intl
COPY . /var/www/html
RUN composer install --no-interaction --prefer-dist --no-scripts \
&& composer dump-autoload --optimize \
&& chown -R www-data:www-data /var/www/html
env_file:
- docker-compose-prod.env
depends_on:
mysql:
condition: service_healthy
networks:
- laravel
- cloudflared #80
horizon:
image: "${APP_DOCKER_STACK}-cli/app:beta-${APP_PHP_VERSION:-8.2}-cli"
pull_policy: build
env_file:
- docker-compose-prod.env
build:
context: .
dockerfile_inline: |
FROM serversideup/php:beta-${APP_PHP_VERSION:-8.2}-cli
RUN install-php-extensions gmp
RUN install-php-extensions intl
RUN docker-php-serversideup-dep-install-debian gosu
COPY . /var/www/html
RUN composer install --no-interaction --prefer-dist --no-scripts \
&& composer dump-autoload --optimize \
&& chown -R www-data:www-data /var/www/html
command: ["gosu", "www-data", "/usr/local/bin/php", "artisan", "horizon"]
depends_on:
mysql:
condition: service_healthy
networks:
- laravel
scheduler:
image: "${APP_DOCKER_STACK}-cli/app:beta-${APP_PHP_VERSION:-8.2}-cli"
pull_policy: build
env_file:
- docker-compose-prod.env
build:
context: .
dockerfile_inline: |
FROM serversideup/php:beta-${APP_PHP_VERSION:-8.2}-cli
RUN install-php-extensions gmp
RUN install-php-extensions intl
RUN docker-php-serversideup-dep-install-debian gosu
COPY . /var/www/html
RUN composer install --no-interaction --prefer-dist --no-scripts \
&& composer dump-autoload --optimize \
&& chown -R www-data:www-data /var/www/html
command: ["gosu", "www-data", "/usr/local/bin/php", "artisan", "schedule:work"]
depends_on:
mysql:
condition: service_healthy
networks:
- laravel
mysql:
image: 'mariadb:10'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-secret}'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: '${DB_DATABASE:-laravel}'
MYSQL_USER: '${DB_USERNAME:-laravel}'
MYSQL_PASSWORD: '${DB_PASSWORD:-secret}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'mysql:/var/lib/mysql'
networks:
- laravel
- cloudflared #3306 TCP !!Use Cloudflare Zero Trust Access Applications for security!!
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
redis:
image: 'redis:alpine'
volumes:
- 'redis:/data'
networks:
- laravel
- cloudflared
healthcheck:
test: ["CMD", "redis-cli", "ping"]
retries: 3
timeout: 5s
minio:
image: 'minio/minio:latest'
environment:
MINIO_ROOT_USER: '${MINIO_ROOT_USER:-laravel}'
MINIO_ROOT_PASSWORD: '${MINIO_ROOT_PASSWORD:-secret}'
volumes:
- 'minio:/data/minio'
networks:
- laravel
- cloudflared #9000 && #8900 !!Use Cloudflare Zero Trust Access Applications for security!!
command: minio server /data/minio --console-address ":8900"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
retries: 3
timeout: 5s
selenium:
image: 'selenium/standalone-chrome'
extra_hosts:
- 'host.docker.internal:host-gateway'
volumes:
- '/dev/shm:/dev/shm'
networks:
- laravel
mailpit:
image: 'axllent/mailpit:latest'
networks:
- laravel
- cloudflared #8025
soketi:
image: 'quay.io/soketi/soketi:latest-16-alpine'
environment:
SOKETI_DEBUG: '${SOKETI_DEBUG:-0}'
SOKETI_METRICS_ENABLED: 1
SOKETI_METRICS_SERVER_PORT: '9601'
env_file:
- docker-compose-prod.env
networks:
- laravel
- cloudflared #6001 websocket-option && #9601 !!Use Cloudflare Zero Trust Access Applications for security!!
meilisearch:
image: 'getmeili/meilisearch:v1.6.1'
environment:
MEILI_MASTER_KEY: '${MEILISEARCH_MASTER_KEY:-masterKey}'
MEILI_NO_ANALYTICS: '${MEILISEARCH_NO_ANALYTICS:-false}'
volumes:
- 'meilisearch:/meili_data'
networks:
- laravel
- cloudflared #7700 !!Use Cloudflare Zero Trust Access Applications for security!!
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--spider", "http://localhost:7700/health"]
retries: 3
timeout: 5s
# [...] https://github.com/laravel/sail/tree/1.x/stubs
seq-input-gelf:
image: datalust/seq-input-gelf:latest
depends_on:
- seq
environment:
SEQ_ADDRESS: "http://${APP_DOCKER_STACK:-mystack}-seq-1"
restart: unless-stopped
networks:
- laravel #12201
seq:
image: datalust/seq:latest
environment:
ACCEPT_EULA: Y
restart: unless-stopped
volumes:
- seq-data:/data
networks:
- laravel
- cloudflared #80 !!Use Cloudflare Zero Trust Access Applications for security!!
## THIS IS FOR BACKING UP MINIO. DATABASE SHOULD BE BACKED UP BY SPATIE/BACKUP
backup:
# Restore backup: https://offen.github.io/docker-volume-backup/how-tos/restore-volumes-from-backup.html
image: offen/docker-volume-backup:v2
restart: always
environment:
NOTIFICATION_URLS: "${BACKUP_NOTIFICATION_URLS}" # Ex: telegram://token@telegram?chats=@channel-1 // ERROR BACKUP
BACKUP_RETENTION_DAYS: "${BACKUP_RETENTION_DAYS:-7}"
BACKUP_COMPRESSION: "gz"
BACKUP_FROM_SNAPSHOT: "true"
NOTIFICATION_LEVEL: "${BACKUP_NOTIFICATION_LEVEL:-error}" // error OR info
AWS_S3_PATH: "${BACKUP_AWS_S3_PATH}"
AWS_S3_BUCKET_NAME: "${BACKUP_AWS_S3_BUCKET_NAME}"
AWS_ACCESS_KEY_ID: "${BACKUP_AWS_ACCESS_KEY_ID}"
AWS_SECRET_ACCESS_KEY: "${BACKUP_AWS_SECRET_ACCESS_KEY}"
AWS_STORAGE_CLASS: "${BACKUP_AWS_STORAGE_CLASS}" // STANDARD OR GLACIER
WEBDAV_URL: "${BACKUP_WEBDAV_URL}"
WEBDAV_PATH: "${BACKUP_WEBDAV_PATH}"
WEBDAV_USERNAME: "${BACKUP_WEBDAV_USERNAME}"
WEBDAV_PASSWORD: "${BACKUP_WEBDAV_PASSWORD}"
SSH_HOST_NAME: "${BACKUP_SSH_HOST_NAME}"
SSH_PORT: "${BACKUP_SSH_PORT}"
SSH_REMOTE_PATH: "${BACKUP_SSH_REMOTE_PATH}"
SSH_USER: "${BACKUP_SSH_USER}"
SSH_PASSWORD: "${BACKUP_SSH_PASSWORD}"
volumes:
- 'minio:/backup/minio:ro'
networks:
laravel:
cloudflared:
external: true
volumes:
mysql:
redis:
minio:
meilisearch:
seq-data: