@@ -55,24 +55,9 @@ services:
5555 depends_on :
5656 - minio
5757 restart : on-failure
58- entrypoint : >
59- /bin/sh -c '
60- echo "Waiting for MinIO to start...";
61- sleep 15;
62- for i in 1 2 3 4 5; do
63- echo "Attempt $i to connect to MinIO...";
64- if /usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin; then
65- echo "Successfully connected to MinIO!";
66- /usr/bin/mc mb --ignore-existing myminio/worklenz-bucket;
67- /usr/bin/mc policy set public myminio/worklenz-bucket;
68- exit 0;
69- fi
70- echo "Connection failed, retrying in 5 seconds...";
71- sleep 5;
72- done;
73- echo "Failed to connect to MinIO after 5 attempts";
74- exit 1;
75- '
58+ entrypoint : ["/bin/sh", "/scripts/createbuckets-entrypoint.sh"]
59+ volumes :
60+ - ./docker/createbuckets-entrypoint.sh:/scripts/createbuckets-entrypoint.sh:ro
7661 networks :
7762 - worklenz
7863 db :
@@ -91,11 +76,13 @@ services:
9176 interval : 10s
9277 timeout : 5s
9378 retries : 5
79+ start_period : 30s
9480 restart : unless-stopped
9581 networks :
9682 - worklenz
9783 volumes :
9884 - worklenz_postgres_data:/var/lib/postgresql/data
85+ - ./docker/db-init-wrapper.sh:/usr/local/bin/db-init-wrapper.sh:ro
9986 - type : bind
10087 source : ./worklenz-backend/database/sql
10188 target : /docker-entrypoint-initdb.d/sql
@@ -111,23 +98,7 @@ services:
11198 - type : bind
11299 source : ./pg_backups
113100 target : /docker-entrypoint-initdb.d/pg_backups
114- command : >
115- bash -c '
116- if command -v apt-get >/dev/null 2>&1; then
117- apt-get update && apt-get install -y dos2unix
118- elif command -v apk >/dev/null 2>&1; then
119- apk add --no-cache dos2unix
120- fi
121-
122- find /docker-entrypoint-initdb.d -type f -name "*.sh" -exec sh -c '"'"'
123- for f; do
124- dos2unix "$f" 2>/dev/null || true
125- chmod +x "$f"
126- done
127- '"'"' sh {} +
128-
129- exec docker-entrypoint.sh postgres
130- '
101+ command : ["/usr/local/bin/db-init-wrapper.sh"]
131102 db-backup :
132103 image : postgres:15
133104 container_name : worklenz_db_backup
0 commit comments