From 3a39d9d6e25c2e4aab18307366d62adb9b0beae9 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 12 Jun 2022 15:33:39 +0200 Subject: [PATCH] Remove arg and start a little safer this time --- Dockerfile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17a347fe..d0aa0ed7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM debian:buster-slim -ARG dir="/home/pi/pialert" - #Update and reduce image size RUN apt-get update \ && apt-get install --no-install-recommends apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ @@ -15,21 +13,21 @@ RUN apt-get update \ # Lighttpd & PHP RUN mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old \ - && ln -s $dir/install/index.html /var/www/html/index.html \ + && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ && lighttpd-enable-mod fastcgi-php -COPY . $dir +COPY . /home/pi/pialert # delete .git/ files and the tar/ realese directory to make the image smaller -#RUN rm -r $dir/.git \ -RUN rm -r $dir/tar +#RUN rm -r /home/pi/pialert/.git \ +RUN rm -r /home/pi/pialert/tar # Pi.Alert -RUN ln -s $dir/front /var/www/html/pialert \ - && python $dir/back/pialert.py update_vendors \ - && (crontab -l 2>/dev/null; cat $dir/install/pialert.cron) | crontab - \ - && chgrp -R www-data $dir/db \ - && chmod -R 770 $dir/db \ +RUN ln -s /home/pi/pialert/front /var/www/html/pialert \ + && python /home/pi/pialert/back/pialert.py update_vendors \ + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - \ + && chgrp -R www-data /home/pi/pialert/db \ + && chmod -R 770 /home/pi/pialert/db \ # changing the default port number 80 to something random, here 20211 && sed -ie 's/= 80/= 20211/g' /etc/lighttpd/lighttpd.conf \ && service lighttpd restart @@ -38,6 +36,6 @@ RUN ln -s $dir/front /var/www/html/pialert \ EXPOSE 20211 # Set up startup script to run two commands, cron and the lighttpd server -RUN chmod +x $dir/dockerfiles/start.sh +RUN chmod +x /home/pi/pialert/dockerfiles/start.sh CMD ["/home/pi/pialert/dockerfiles/start.sh"]