add failcheck on startup

master
Dirk Heilig 2023-10-15 20:17:24 +02:00
parent 01a56069d8
commit fb04ad57bf
2 changed files with 9 additions and 1 deletions

View File

@ -9,4 +9,5 @@ ADD htdocs /var/www/html
RUN mkdir /var/www/data RUN mkdir /var/www/data
RUN chown www-data:www-data /var/www/ -R RUN chown www-data:www-data /var/www/ -R
EXPOSE 80 EXPOSE 80
CMD apachectl -D FOREGROUND ADD start.sh /usr/local/bin/start.sh
CMD /usr/local/bin/start.sh

7
start.sh 100755
View File

@ -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