Skip to content

Commit 126dfde

Browse files
paopao
pao
authored and
pao
committed
Add container file
1 parent 5b0a72d commit 126dfde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
FROM postgres:16
22

3-
COPY docker-ensure-no-initdb-if-exist.sh /usr/local/bin/docker-ensure-initdb.sh
4-
RUN rm -f /usr/local/bin/docker-enforce-initdb.sh && ln -sT docker-ensure-initdb.sh /usr/local/bin/docker-enforce-initdb.sh
3+
# Set working directory
4+
WORKDIR /var/lib/postgresql/data
55

6-
ENTRYPOINT ["docker-entrypoint.sh"]
6+
# Check if the database directory exists (indicates existing data)
7+
RUN [ ! -d "$PGDATA" ] && echo "Database directory not found, initializing..." || echo "Database directory found, skipping initialization."
8+
9+
#ENTRYPOINT ["docker-entrypoint.sh"]

0 commit comments

Comments
 (0)