mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
fix database import by waiting for the database to start
Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
parent
9d9da9e47c
commit
48e60872b3
2 changed files with 6 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# From https://github.com/docker-library/postgres/blob/master/13/alpine/Dockerfile
|
# From https://github.com/docker-library/postgres/blob/master/13/alpine/Dockerfile
|
||||||
FROM postgres:13.5-alpine3.15
|
FROM postgres:13.5-alpine3.15
|
||||||
|
|
||||||
RUN apk add --update --no-cache bash openssl shadow
|
RUN apk add --update --no-cache bash openssl shadow netcat-openbsd
|
||||||
|
|
||||||
# We need to use the same gid and uid as on old installations
|
# We need to use the same gid and uid as on old installations
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,11 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
|
||||||
# Create new database
|
# Create new database
|
||||||
exec docker-entrypoint.sh postgres &
|
exec docker-entrypoint.sh postgres &
|
||||||
|
|
||||||
# Wait 10s for creation
|
# Wait for creation
|
||||||
sleep 10s
|
while ! nc -z localhost 11000; do
|
||||||
|
echo "Waiting for the database to start."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
# Set correct permissions
|
# Set correct permissions
|
||||||
if grep -q "Owner: oc_admin" "$DUMP_FILE" && ! grep -q "Owner: oc_$POSTGRES_USER" "$DUMP_FILE"; then
|
if grep -q "Owner: oc_admin" "$DUMP_FILE" && ! grep -q "Owner: oc_$POSTGRES_USER" "$DUMP_FILE"; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue