@@ -20,6 +20,10 @@ services:
20
20
- " ${POSTGRES_PORT:-5430}:5432"
21
21
volumes :
22
22
- ${POSTGRES_DATA_VOLUME:-postgres_data}:/var/lib/postgresql/data
23
+ configs :
24
+ - source : postgres_init
25
+ target : /docker-entrypoint-initdb.d/01-create-iceberg-catalog.sh
26
+ mode : 0755
23
27
command : >
24
28
postgres
25
29
-N 1000
@@ -33,24 +37,6 @@ services:
33
37
timeout : 5s
34
38
retries : 5
35
39
36
- # Create database for iceberg catalog
37
- create-catalog-db :
38
- image : postgres:17
39
- container_name : create-catalog-db
40
- depends_on :
41
- postgres :
42
- condition : service_healthy
43
- environment :
44
- PGHOST : postgres
45
- PGPORT : 5432
46
- PGUSER : ${POSTGRES_USER:-postgres}
47
- PGPASSWORD : ${POSTGRES_PASSWORD:-postgres}
48
- entrypoint : >
49
- /bin/sh -c "
50
- psql -c 'create database \"iceberg-catalog\";';
51
- exit 0;
52
- "
53
-
54
40
# Start MinIO for S3-compatible object storage
55
41
minio :
56
42
image : minio/minio:latest
@@ -93,8 +79,8 @@ services:
93
79
restart : " no"
94
80
command : ["migrate"]
95
81
depends_on :
96
- create-catalog-db :
97
- condition : service_completed_successfully
82
+ postgres :
83
+ condition : service_healthy
98
84
99
85
# Start lakekeeper, an iceberg REST catalog
100
86
lakekeeper :
@@ -168,6 +154,16 @@ services:
168
154
volumes :
169
155
- ./warehouse.json:/home/curl_user/warehouse.json
170
156
157
+ configs :
158
+ postgres_init :
159
+ content : |
160
+ #!/bin/bash
161
+ set -e
162
+
163
+ psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER:-postgres}" --dbname "${POSTGRES_DB:-postgres}" <<-EOSQL
164
+ CREATE DATABASE "iceberg-catalog";
165
+ EOSQL
166
+
171
167
volumes :
172
168
postgres_data :
173
169
driver : local
0 commit comments