create wrapper script in order to wait for Nextcloud to start

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L 2023-10-30 16:52:42 +01:00
parent 2a33a89722
commit b42dea27a2
2 changed files with 24 additions and 0 deletions

View file

@ -3,5 +3,17 @@ WORKDIR /app
COPY ./build/libs/* ./nextcloud-dlna.jar
RUN set -ex; \
export DEBIAN_FRONTEND=noninteractive; \
apt-get update; \
apt-get install -y --no-install-recommends \
tzdata \
netcat-openbsd \
; \
rm -rf /var/lib/apt/lists/*;
COPY --chmod=775 start.sh /start.sh
EXPOSE 8080
ENTRYPOINT /start.sh
CMD ["java","-jar","nextcloud-dlna.jar"]

12
start.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
# Wait for Nextcloud to come online
if [ -n "$NC_DOMAIN" ] && [ "$NC_PORT" ]; then
while ! nc -z "$NC_DOMAIN" "$NC_PORT"; do
echo "Waiting for Nextcloud to start..."
sleep 5
done
fi
# Execute CMD
exec /__cacert_entrypoint.sh "$@"