-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcompose.yml
More file actions
240 lines (225 loc) · 8.32 KB
/
Copy pathcompose.yml
File metadata and controls
240 lines (225 loc) · 8.32 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
234
235
236
237
238
239
240
volumes:
postgres-data:
redis-data:
mailpit-data:
services:
web:
image: ghcr.io/myspeedpuzzling/web-base-php85:main
restart: unless-stopped
tty: true
volumes:
- .:/app
- .docker/on-startup.sh:/docker-entrypoint.d/on-startup.sh
- .docker-data/caddy-data:/data
- .docker-data/caddy-config:/config
depends_on:
- postgres
- redis
- minio
- mercure
ports:
- "${WEB_PORT:-8080}:8080"
environment:
FRANKENPHP_WORKER: "1"
FRANKENPHP_WATCH: "1"
FRANKENPHP_MAX_WAIT_TIME: "30s"
FRANKENPHP_WORKER_NUM: "15"
XDEBUG_CONFIG: "client_host=host.docker.internal"
XDEBUG_MODE: debug
PHP_IDE_CONFIG: "serverName=speedpuzzling"
postgres:
image: postgres:16.0
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: speedpuzzling
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
js-watch:
image: ghcr.io/myspeedpuzzling/web-base-php85:main
volumes:
- .:/app
restart: unless-stopped
entrypoint: [""]
command: ["bash", "-c", "npm install && npm run watch"]
tty: true
redis:
image: redis:7.2
restart: unless-stopped
volumes:
- redis-data:/data
mercure:
image: dunglas/mercure
restart: unless-stopped
command: caddy run --config /etc/caddy/dev.Caddyfile
environment:
MERCURE_PUBLISHER_JWT_KEY: "dummy-local-secret-key-for-development-only!"
MERCURE_SUBSCRIBER_JWT_KEY: "dummy-local-secret-key-for-development-only!"
SERVER_NAME: ":80"
MERCURE_EXTRA_DIRECTIVES: |
cors_origins http://localhost:8080
ports:
- "${MERCURE_PORT:-8082}:80"
adminer:
image: adminer:5.4.1
ports:
- "${ADMINER_PORT:-8000}:8080"
environment:
ADMINER_DEFAULT_SERVER: postgres
depends_on:
- postgres
imgproxy:
image: darthsim/imgproxy:latest
restart: unless-stopped
environment:
IMGPROXY_USE_S3: "true"
IMGPROXY_S3_REGION: "global"
IMGPROXY_S3_ENDPOINT: "http://minio:9000"
AWS_ACCESS_KEY_ID: "speedpuzzling"
AWS_SECRET_ACCESS_KEY: "speedpuzzling"
IMGPROXY_PREFERRED_FORMATS: "avif,webp,jpeg"
IMGPROXY_AUTO_AVIF: "true"
IMGPROXY_AUTO_WEBP: "true"
IMGPROXY_BASE_URL: "s3://puzzle/"
IMGPROXY_PRESETS: "puzzle_small=rs:fit:200:200,puzzle_medium=rs:fit:400:400/el:1,avatar=rs:fit:300:300"
IMGPROXY_JPEG_QUALITY: "88"
IMGPROXY_WEBP_QUALITY: "82"
IMGPROXY_AVIF_QUALITY: "65"
IMGPROXY_AUTO_ROTATE: "true"
IMGPROXY_ENFORCE_THUMBNAIL: "true"
IMGPROXY_STRIP_METADATA: "true"
IMGPROXY_STRIP_COLOR_PROFILE: "true"
IMGPROXY_AVIF_SPEED: "7"
IMGPROXY_MAX_SRC_RESOLUTION: "50"
depends_on:
- minio
images-cache:
image: nginx:alpine
restart: unless-stopped
volumes:
- .docker/nginx-imgproxy.conf:/etc/nginx/conf.d/default.conf
- .docker-data/imgproxy-cache:/var/cache/nginx/imgproxy
depends_on:
- imgproxy
ports:
- "${IMAGES_CACHE_PORT:-19100}:80"
minio:
restart: always
image: minio/minio:latest
environment:
MINIO_DOMAIN: "localhost:19000"
MINIO_SERVER_URL: "http://minio:9000"
MINIO_BROWSER_REDIRECT_URL: "http://localhost:19001"
MINIO_ROOT_USER: speedpuzzling
MINIO_ROOT_PASSWORD: speedpuzzling
command: ["server", "/data", "--console-address", ":9001"]
ports:
- "${MINIO_API_PORT:-19000}:9000"
- "${MINIO_CONSOLE_PORT:-19001}:9001"
volumes:
- .docker-data/minio-data:/data
mailer:
image: axllent/mailpit
ports:
- "${MAILER_SMTP_PORT:-1025}:1025"
- "${MAILER_UI_PORT:-8025}:8025"
environment:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
MP_DATABASE: "/data/mailpit.db"
volumes:
- mailpit-data:/data
chrome:
image: ${SELENIUM_IMAGE:-seleniarm/standalone-chromium:latest}
shm_size: 2gb
ports:
- "${CHROME_PORT:-4444}:4444"
- "${CHROME_VNC_PORT:-7900}:7900"
environment:
- SE_NODE_MAX_SESSIONS=4
web-test:
image: ghcr.io/myspeedpuzzling/web-base-php85:main
restart: unless-stopped
tty: true
volumes:
- .:/app
- .docker/on-startup.sh:/docker-entrypoint.d/on-startup.sh
tmpfs:
- /app/var/cache
depends_on:
- web
- chrome
ports:
- "${WEB_TEST_PORT:-8081}:8080"
environment:
APP_ENV: test
# Skip migrations - test database is set up by PHPUnit bootstrap.php
SKIP_DATABASE_MIGRATIONS: "true"
listmonk-init:
image: postgres:16.0
environment:
PGPASSWORD: postgres
command: >
sh -c "psql -h postgres -U postgres -tc \"SELECT 1 FROM pg_database WHERE datname = 'listmonk'\" | grep -q 1 || psql -h postgres -U postgres -c \"CREATE DATABASE listmonk\""
depends_on:
postgres:
condition: service_healthy
# Idempotently seeds the api-dev API user into Listmonk so the LISTMONK_*
# dev defaults in .env work out of the box (tokens are stored in plain text
# in the listmonk users table, so the row can be seeded deterministically)
listmonk-seed:
image: postgres:16.0
environment:
PGPASSWORD: postgres
command: >
sh -c "i=0; until psql -h postgres -U postgres -d listmonk -tc 'SELECT 1 FROM users' >/dev/null 2>&1; do i=$$((i+1)); [ $$i -ge 60 ] && exit 1; sleep 1; done;
psql -h postgres -U postgres -d listmonk -c \"INSERT INTO users (username, password_login, password, email, name, type, user_role_id, status) SELECT 'api-dev', false, 'MVNawj1IBdVcCPvwfTd5GSsjT44HUMot', 'api-dev@api', 'API Dev', 'api', 1, 'enabled' WHERE NOT EXISTS (SELECT 1 FROM users WHERE username = 'api-dev')\""
depends_on:
listmonk:
condition: service_started
listmonk:
image: listmonk/listmonk:latest
restart: unless-stopped
ports:
- "${LISTMONK_PORT:-8090}:9000"
environment:
TZ: Europe/Prague
LISTMONK_app__address: 0.0.0.0:9000
# Install-time bootstrap of the super admin (only takes effect when
# `--install` runs against an empty database)
LISTMONK_ADMIN_USER: admin
LISTMONK_ADMIN_PASSWORD: adminadmin
LISTMONK_db__host: postgres
LISTMONK_db__port: 5432
LISTMONK_db__user: postgres
LISTMONK_db__password: postgres
LISTMONK_db__database: listmonk
LISTMONK_db__ssl_mode: disable
LISTMONK_db__max_open: 25
LISTMONK_db__max_idle: 25
LISTMONK_db__max_lifetime: 300s
LISTMONK_smtp__enabled: true
LISTMONK_smtp__host: mailer
LISTMONK_smtp__port: 1025
LISTMONK_smtp__auth_protocol: none
LISTMONK_smtp__tls_type: none
LISTMONK_smtp__max_conns: 10
LISTMONK_smtp__idle_timeout: 15s
LISTMONK_smtp__wait_timeout: 5s
LISTMONK_smtp__max_msg_retries: 2
command: >
sh -c "./listmonk --install --idempotent --yes --config '' &&
./listmonk --upgrade --yes --config '' &&
./listmonk --config ''"
depends_on:
listmonk-init:
condition: service_completed_successfully
mailer:
condition: service_started