From 5c5cb6e51c2ea2962a39ffea3d438c73954fa5ba Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 29 Apr 2021 09:59:18 +0200 Subject: [PATCH] fix: add missing healthcheck script --- .drone.star | 15 ++++++++------- Dockerfile => docker/Dockerfile | 1 + docker/overlay/usr/bin/healthcheck | 10 ++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) rename Dockerfile => docker/Dockerfile (97%) create mode 100755 docker/overlay/usr/bin/healthcheck diff --git a/.drone.star b/.drone.star index 58e593409ca..dd0ee7f15ad 100644 --- a/.drone.star +++ b/.drone.star @@ -1212,13 +1212,14 @@ def buildDockerImage(): 'pull': 'always', 'settings': { 'username': { - 'from_secret': 'docker_username', - }, - 'password': { - 'from_secret': 'docker_password', - }, - 'auto_tag': True, - 'repo': 'owncloud/web', + 'from_secret': 'docker_username', + }, + 'password': { + 'from_secret': 'docker_password', + }, + 'auto_tag': True, + 'dockerfile': 'docker/Dockerfile', + 'repo': 'owncloud/web', }, 'when': { 'ref': { diff --git a/Dockerfile b/docker/Dockerfile similarity index 97% rename from Dockerfile rename to docker/Dockerfile index b074c68a945..21dfe16f380 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -12,6 +12,7 @@ LABEL maintainer="ownCloud GmbH " \ RUN rm -f /var/lib/nginx/html/* +ADD docker/overlay / ADD dist/ /var/lib/nginx/html EXPOSE 8080 diff --git a/docker/overlay/usr/bin/healthcheck b/docker/overlay/usr/bin/healthcheck new file mode 100755 index 00000000000..7e5f13efa9a --- /dev/null +++ b/docker/overlay/usr/bin/healthcheck @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +set -eo pipefail + +URL=http://127.0.0.1:8080 + +wget --quiet --tries=1 --spider ${URL} +[ $? -ne 0 ] && exit 1 + +exit 0