@@ -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
@@ -92,8 +78,8 @@ services:
92
78
restart : " no"
93
79
command : ["migrate"]
94
80
depends_on :
95
- create-catalog-db :
96
- condition : service_completed_successfully
81
+ postgres :
82
+ condition : service_healthy
97
83
98
84
# Start lakekeeper, an iceberg REST catalog
99
85
lakekeeper :
@@ -167,6 +153,16 @@ services:
167
153
volumes :
168
154
- ./warehouse.json:/home/curl_user/warehouse.json
169
155
156
+ configs :
157
+ postgres_init :
158
+ content : |
159
+ #!/bin/bash
160
+ set -e
161
+
162
+ psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER:-postgres}" --dbname "${POSTGRES_DB:-postgres}" <<-EOSQL
163
+ CREATE DATABASE "iceberg-catalog";
164
+ EOSQL
165
+
170
166
volumes :
171
167
postgres_data :
172
168
driver : local
0 commit comments