File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,12 @@ services:
1616 - postgres_data:/var/lib/postgresql/data
1717 # If things really need to be wiped, uncomment the destructive entrypoint below.
1818 # This will remove all old data in the database, and rebuild it from scratch.
19- # entrypoint: [ "bash", "-c", "\
20- # echo 'WIPING OLD POSTGRES DATA...'; \
21- # rm -rf /var/lib/postgresql/data/*; \
22- # exec docker-entrypoint.sh postgres \
23- # " ]
19+ entrypoint : [ "bash", "-c", "\
20+ if [ ! -f /var/lib/postgresql/data/PG_VERSION ]; then \
21+ echo 'Database seems uninitialized. WIPING AND REBUILDING...'; \
22+ rm -rf /var/lib/postgresql/data/*; \
23+ fi; \
24+ exec docker-entrypoint.sh postgres " ]
2425 healthcheck :
2526 test : ["CMD-SHELL", "pg_isready -U postgres"]
2627 interval : 30s
You can’t perform that action at this time.
0 commit comments