From fb04ad57bfd1cec76fe142309f93780b9b30ae4e Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Sun, 15 Oct 2023 20:17:24 +0200 Subject: [PATCH] add failcheck on startup --- Dockerfile | 3 ++- start.sh | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 start.sh diff --git a/Dockerfile b/Dockerfile index 547414c..f6a738c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,4 +9,5 @@ ADD htdocs /var/www/html RUN mkdir /var/www/data RUN chown www-data:www-data /var/www/ -R EXPOSE 80 -CMD apachectl -D FOREGROUND +ADD start.sh /usr/local/bin/start.sh +CMD /usr/local/bin/start.sh diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..87cb5f9 --- /dev/null +++ b/start.sh @@ -0,0 +1,7 @@ + #!/usr/bin/env bash + set -e + find /var/www -not -user www-data | grep -q /var && { + echo "ERROR: /var/www or one or more of it's children is not owned by www-data:www-data" + exit 1 + } + apachectl -D FOREGROUND