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:
parent
2a33a89722
commit
b42dea27a2
2 changed files with 24 additions and 0 deletions
12
Dockerfile
12
Dockerfile
|
@ -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
12
start.sh
Normal 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 "$@"
|
Loading…
Reference in a new issue