Merge pull request #17 from szaimen/master
create wrapper script in order to wait for Nextcloud to start
This commit is contained in:
commit
d31e30aa68
2 changed files with 25 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"]
|
||||
|
|
13
start.sh
Normal file
13
start.sh
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Wait for Nextcloud to come online
|
||||
if [ -n "$NC_DOMAIN" ] && [ -n "$NC_PORT" ]; then
|
||||
while ! nc -z "$NC_DOMAIN" "$NC_PORT"; do
|
||||
echo "Waiting for Nextcloud to start on $NC_DOMAIN:$NC_PORT..."
|
||||
sleep 5
|
||||
done
|
||||
echo "Nextcloud found on $NC_DOMAIN:$NC_PORT!"
|
||||
fi
|
||||
|
||||
# Execute CMD
|
||||
exec /__cacert_entrypoint.sh "$@"
|
Loading…
Reference in a new issue