-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
274 lines (267 loc) · 8.51 KB
/
docker-compose.dev.yml
File metadata and controls
274 lines (267 loc) · 8.51 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
services:
traefik:
ports:
- "80:80"
- "443:443"
# - "8080:8080" # Uncomment to enable Traefik's dashboard
networks:
development:
aliases:
- laravel.dev.test
- vite.dev.test
- mailpit.dev.test
- reverb.dev.test
- console.laravel.dev.test
- media.laravel.dev.test
- meilisearch.dev.test
volumes:
# Mount the Docker socket as read-only so Traefik can listen to events
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./.infrastructure/conf/traefik/dev/traefik.yml:/traefik.yml:ro
- ./.infrastructure/conf/traefik/dev/traefik-certs.yml:/traefik-certs.yml
- ./.infrastructure/conf/traefik/dev/certificates/:/certificates
php:
build:
target: development
args:
USER_ID: ${SPIN_USER_ID}
GROUP_ID: ${SPIN_GROUP_ID}
dockerfile: Dockerfile.php
stop_signal: SIGTERM
volumes:
- .:/var/www/html/
networks:
- development
depends_on:
postgres:
condition: service_started
labels:
- "traefik.enable=true"
- "traefik.http.routers.laravel-web.rule=Host(`laravel.dev.test`) || HostRegexp(`^.+\\.ngrok-free\\.app$$`)"
- "traefik.http.routers.laravel-web.tls=true"
- "traefik.http.routers.laravel-web.entrypoints=websecure"
- "traefik.http.services.laravel-web.loadbalancer.server.port=8443"
- "traefik.http.services.laravel-web.loadbalancer.server.scheme=https"
node:
build:
target: development
args:
USER_ID: ${SPIN_USER_ID}
GROUP_ID: ${SPIN_GROUP_ID}
dockerfile: Dockerfile.node
command: npm run dev
volumes:
- .:/usr/src/app/
working_dir: /usr/src/app/
networks:
- development
ssr:
build:
dockerfile: Dockerfile.ssr
command: node bootstrap/ssr/ssr.js
networks:
- development
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:13714/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
labels:
- "traefik.enable=true"
- "traefik.http.routers.vite.rule=HostRegexp(`vite.dev.test`)"
- "traefik.http.routers.vite.entrypoints=websecure"
- "traefik.http.routers.vite.tls=true"
- "traefik.http.services.vite.loadbalancer.server.port=5173"
- "traefik.http.services.vite.loadbalancer.server.scheme=https"
mailpit:
image: axllent/mailpit
networks:
- development
labels:
- "traefik.enable=true"
- "traefik.http.routers.mailpit.rule=Host(`mailpit.dev.test`)"
- "traefik.http.routers.mailpit.entrypoints=websecure"
- "traefik.http.routers.mailpit.tls=true"
- "traefik.http.services.mailpit.loadbalancer.server.port=8025"
- "traefik.http.services.mailpit.loadbalancer.server.scheme=http"
schedule:
build:
target: development
args:
USER_ID: ${SPIN_USER_ID}
GROUP_ID: ${SPIN_GROUP_ID}
dockerfile: Dockerfile.php
volumes:
- .:/var/www/html/
networks:
- development
depends_on:
php:
condition: service_started
postgres:
condition: service_healthy
postgres:
networks:
- development
volumes:
- ./.infrastructure/volume_data/postgres/database_data/:/var/lib/postgresql
- './.infrastructure/conf/database/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
environment:
POSTGRES_DB: "laravel"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgrespassword"
ports:
- target: 5432
published: 5432
mode: host
redis:
command: "redis-server --appendonly yes --requirepass redispassword"
volumes:
- ./.infrastructure/volume_data/redis/data:/data
networks:
- development
horizon:
build:
target: development
args:
USER_ID: ${SPIN_USER_ID}
GROUP_ID: ${SPIN_GROUP_ID}
dockerfile: Dockerfile.php
volumes:
- .:/var/www/html/
networks:
- development
depends_on:
redis:
condition: service_healthy
php:
condition: service_started
reverb:
build:
target: development
args:
USER_ID: ${SPIN_USER_ID}
GROUP_ID: ${SPIN_GROUP_ID}
dockerfile: Dockerfile.php
volumes:
- .:/var/www/html/
networks:
- development
labels:
- "traefik.enable=true"
- "traefik.http.routers.laravel-reverb.rule=Host(`reverb.dev.test`)"
- "traefik.http.routers.laravel-reverb.entrypoints=websecure"
- "traefik.http.routers.laravel-reverb.tls=true"
- "traefik.http.services.laravel-reverb.loadbalancer.server.port=8000"
- "traefik.http.services.laravel-reverb.loadbalancer.server.scheme=http"
depends_on:
php:
condition: service_started
postgres:
condition: service_healthy
# Replace MinIO service with RustFS for development environment
rustfs:
image: rustfs/rustfs:latest
security_opt:
- "no-new-privileges:true"
environment:
RUSTFS_VOLUMES: '/data'
RUSTFS_ADDRESS: '0.0.0.0:9000'
RUSTFS_CONSOLE_ADDRESS: '0.0.0.0:9001'
RUSTFS_CONSOLE_ENABLE: 'true'
RUSTFS_EXTERNAL_ADDRESS: ':9000'
RUSTFS_CORS_ALLOWED_ORIGINS: '*'
RUSTFS_CONSOLE_CORS_ALLOWED_ORIGINS: '*'
RUSTFS_ACCESS_KEY: 'rust'
RUSTFS_SECRET_KEY: 'password'
RUSTFS_LOG_LEVEL: 'info'
RUSTFS_OBS_LOGGER_LEVEL: 'info'
volumes:
- ./.infrastructure/volume_data/rustfs/data:/data
- ./.infrastructure/volume_data/rustfs/logs:/app/logs
healthcheck:
test:
[
"CMD",
"sh", "-c",
"curl -f http://localhost:9000/health && curl -f http://localhost:9001/rustfs/console/health"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- development
restart: unless-stopped
labels:
- "traefik.enable=true"
# ---------- API ----------
- "traefik.http.routers.rustfs-api.rule=Host(`media.laravel.dev.test`)"
- "traefik.http.routers.rustfs-api.entrypoints=websecure"
- "traefik.http.routers.rustfs-api.tls=true"
- "traefik.http.routers.rustfs-api.priority=20"
- "traefik.http.routers.rustfs-api.service=rustfs-api-svc"
- "traefik.http.services.rustfs-api-svc.loadbalancer.server.port=9000"
- "traefik.http.services.rustfs-api-svc.loadbalancer.server.scheme=http"
# ---------- Console ----------
- "traefik.http.routers.rustfs-console.rule=Host(`console.laravel.dev.test`)"
- "traefik.http.routers.rustfs-console.entrypoints=websecure"
- "traefik.http.routers.rustfs-console.tls=true"
- "traefik.http.routers.rustfs-console.priority=10"
- "traefik.http.routers.rustfs-console.service=rustfs-console-svc"
- "traefik.http.services.rustfs-console-svc.loadbalancer.server.port=9001"
- "traefik.http.services.rustfs-console-svc.loadbalancer.server.scheme=http"
volume-permission-helper:
image: alpine
volumes:
- ./.infrastructure/volume_data/rustfs/data:/data
- ./.infrastructure/volume_data/rustfs/logs:/logs
command: >
sh -c "
chown -R 10001:10001 /data /logs &&
echo 'Volume Permissions fixed' &&
exit 0
"
restart: "no"
# Use mc (minio client) to create the bucket and set public policy against RustFS
# bucket-user-init:
# image: serversideup/minio-user-init:latest
# depends_on:
# rustfs:
# condition: service_healthy
# networks:
# - development
# environment:
# MINIO_ADMIN_USER: "rust"
# MINIO_ADMIN_PASSWORD: "password"
# MINIO_ALIAS: "rustfs"
# MINIO_HOST: "http://rustfs:9000"
# MINIO_USER_ACCESS_KEY: "media_user"
# MINIO_USER_SECRET_KEY: "a5hU92!aPoxxxj2@T3s$"
# MINIO_USER_BUCKET: "media"
# MINIO_USER_BUCKET_PERMISSIONS: "s3:ListBucket,s3:GetBucketLocation"
# MINIO_USER_OBJECT_PERMISSIONS: "s3:PutObject,s3:GetObject"
rustfs-bucket-init:
image: minio/mc:latest
depends_on:
rustfs:
condition: service_healthy
networks:
- development
entrypoint: >
/bin/sh -c "
sleep 5;
/usr/bin/mc alias set rustfs http://rustfs:9000 $RUSTFS_ACCESS_KEY $RUSTFS_SECRET_KEY &&
/usr/bin/mc mb rustfs/$RUSTFS_BUCKET || true &&
/usr/bin/mc anonymous set download rustfs/$RUSTFS_BUCKET
exit 0;
"
command: >
environment:
RUSTFS_ACCESS_KEY: rust
RUSTFS_SECRET_KEY: password
RUSTFS_BUCKET: media
restart: "no"
networks:
development: