-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.dev.yml
More file actions
76 lines (72 loc) · 2.14 KB
/
compose.dev.yml
File metadata and controls
76 lines (72 loc) · 2.14 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
services:
db:
image: postgres:17
restart: no
volumes:
- db:/var/lib/postgresql/data
# set shared memory limit when using docker compose
shm_size: 128mb
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: form-forge
ports:
- "5434:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: "5s"
timeout: "5s"
retries: 5
adminer:
image: adminer:5
restart: no
depends_on:
- db
ports:
- "8082:8080"
rustfs:
image: rustfs/rustfs:latest
restart: no
environment:
RUSTFS_ROOT_USER: rustfsadmin
RUSTFS_ROOT_PASSWORD: rustfsadmin
RUSTFS_VOLUMES: /data/rustfs0
# Webhook notification for object deletions (lifecycle expiration)
RUSTFS_NOTIFY_WEBHOOK_ENABLE_primary: "on"
RUSTFS_NOTIFY_WEBHOOK_ENDPOINT_primary: "http://host.docker.internal:8081/internal/s3-events"
RUSTFS_NOTIFY_WEBHOOK_QUEUE_DIR_primary: "/data/rustfs0/.events"
ports:
- "9000:9000" # S3 API
- "9001:9001" # Web Console
volumes:
- rustfs_data:/data
extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 9000 || exit 1"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
# Initialize bucket, lifecycle rules, and webhook events on startup
createbuckets:
image: quay.io/minio/mc:latest
depends_on:
rustfs:
condition: service_healthy
restart: "no"
volumes:
- ./config/lifecycle.json:/lifecycle.json:ro
entrypoint: /bin/sh
command:
- -c
- |
/usr/bin/mc alias set rustfs http://rustfs:9000 rustfsadmin rustfsadmin
/usr/bin/mc mb --ignore-existing rustfs/form-forge
/usr/bin/mc ilm import rustfs/form-forge < /lifecycle.json
/usr/bin/mc event remove rustfs/form-forge --force || true
/usr/bin/mc event add rustfs/form-forge arn:rustfs:sqs::primary:webhook --event delete || true
echo "Bucket 'form-forge' initialized with lifecycle rules and webhook events"
volumes:
db:
rustfs_data: