diff --git a/Dockerfile b/Dockerfile index d0b91b4..78173db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM thallian/confd-env:latest ENV PGDATA=/var/lib/postgresql/data -ENV S6_KEEP_ENV=1 RUN apk add --no-cache \ postgresql14 \ diff --git a/rootfs/bin/initdb b/rootfs/bin/initdb index c4412d3..ea0a192 100755 --- a/rootfs/bin/initdb +++ b/rootfs/bin/initdb @@ -1,5 +1,5 @@ #!/command/with-contenv sh -if [ ! -f "/var/lib/postgresql/data/PG_VERSION" ]; then - s6-setuidgid postgres initdb --username=postgres +if [ ! -f "$PGDATA/PG_VERSION" ]; then + initdb --username=postgres fi