-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (118 loc) · 3.84 KB
/
Copy pathdocker-compose.yml
File metadata and controls
123 lines (118 loc) · 3.84 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
services:
# ---------------------------------------------------------------------------
# PostgreSQL 16
# ---------------------------------------------------------------------------
postgres:
image: postgres:16-alpine
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: vastu
POSTGRES_PASSWORD: vastu
POSTGRES_DB: vastu
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/postgres/init-keycloak-db.sh:/docker-entrypoint-initdb.d/init-keycloak-db.sh:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U vastu"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# ---------------------------------------------------------------------------
# Redis 7
# ---------------------------------------------------------------------------
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
# ---------------------------------------------------------------------------
# Keycloak 24
# The realm-export.json is imported on first start via --import-realm.
# ---------------------------------------------------------------------------
keycloak:
image: quay.io/keycloak/keycloak:24.0
restart: unless-stopped
command: start-dev --import-realm
ports:
- "8080:8080"
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_DB: postgres
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
KC_DB_USERNAME: vastu
KC_DB_PASSWORD: vastu
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
volumes:
- ./docker/keycloak/realm-export.json:/opt/keycloak/data/import/realm-export.json:ro
depends_on:
postgres:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"exec 3<>/dev/tcp/localhost/8080 && echo -e 'GET /health/ready HTTP/1.0\r\nHost: localhost\r\n\r\n' >&3 && cat <&3 | grep -q '200 OK'"
]
interval: 30s
timeout: 10s
retries: 10
start_period: 60s
# ---------------------------------------------------------------------------
# MinIO (S3-compatible object storage)
# ---------------------------------------------------------------------------
minio:
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
ports:
- "9000:9000" # API
- "9001:9001" # Console
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# ---------------------------------------------------------------------------
# MinIO bucket initialisation (one-shot)
# Creates the vastu-uploads bucket after MinIO is healthy.
# ---------------------------------------------------------------------------
createbuckets:
image: minio/mc:latest
restart: "no"
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb --ignore-existing local/vastu-uploads;
mc anonymous set download local/vastu-uploads;
echo 'Bucket vastu-uploads is ready.';
exit 0;
"
# ---------------------------------------------------------------------------
# Named volumes — all removed cleanly by: docker compose down -v
# ---------------------------------------------------------------------------
volumes:
postgres_data:
redis_data:
minio_data: