From 4e65bd946d9a4dc855c5756c003997e5a94c71c4 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 22:57:40 +0200 Subject: [PATCH 01/43] optimize a little bit --- Dockerfile | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7d0bb558..4f3305a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,35 +7,26 @@ RUN apt-get update \ && apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ && apt-get clean autoclean \ && apt-get autoremove \ - && rm -rf /var/lib/apt/lists/* - -# Lighttpd & PHP -RUN mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old \ - && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ - && lighttpd-enable-mod fastcgi-php + && rm -rf /var/lib/apt/lists/* \ + ln -s /home/pi/pialert/install/index.html /var/www/html/index.html + # Redirect for lighthttpd to work properly COPY . /home/pi/pialert -# Todo, is this tar part still needed? - # delete .git/ files and the tar/ realese directory to make the image smaller #RUN rm -r /home/pi/pialert/.git \ RUN rm -r /home/pi/pialert/tar -# Todo, do we need to restart lighthttpd? - # Pi.Alert 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 + #&& chgrp -R www-data /home/pi/pialert/db \ + && chmod -R 777 /home/pi/pialert/db -EXPOSE 20211 +EXPOSE 80 -# Todo, can we just use CMD and ENTRYPOINT instead of a script? +# -CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file +ENTRYPOINT ["/usr/sbin/lighttpd"] +CMD ["-D", "-f", "/etc/lighttpd/lighttpd.conf", "&","cron"] \ No newline at end of file From e0fe7060328a215b9b83802aa2498bfc56cfd45f Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 22:59:17 +0200 Subject: [PATCH 02/43] Forgot added new line in first RUN --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4f3305a5..1759cd59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update \ && apt-get clean autoclean \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* \ - ln -s /home/pi/pialert/install/index.html /var/www/html/index.html + && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html # Redirect for lighthttpd to work properly COPY . /home/pi/pialert From 07de6cd17ae1b53a946c2e5228946268962957bf Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:06:27 +0200 Subject: [PATCH 03/43] added lighttpd-enable-mod fastcgi-php to fix the permission --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1759cd59..26f945ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,14 +8,14 @@ RUN apt-get update \ && apt-get clean autoclean \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* \ - && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html + && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html # Redirect for lighthttpd to work properly COPY . /home/pi/pialert # delete .git/ files and the tar/ realese directory to make the image smaller #RUN rm -r /home/pi/pialert/.git \ -RUN rm -r /home/pi/pialert/tar +RUN rm -r /home/pi/pialert/tar && lighttpd-enable-mod fastcgi-php # Pi.Alert RUN ln -s /home/pi/pialert/front /var/www/html/pialert \ From da99fb798765d4f8da531716c76099c4d7505d48 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:10:41 +0200 Subject: [PATCH 04/43] make it actually run? --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 26f945ae..e7de8c67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,4 +29,4 @@ EXPOSE 80 # ENTRYPOINT ["/usr/sbin/lighttpd"] -CMD ["-D", "-f", "/etc/lighttpd/lighttpd.conf", "&","cron"] \ No newline at end of file +CMD ["-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file From ef0c06f4857869dc9255dc2da26fc32b93670692 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:13:20 +0200 Subject: [PATCH 05/43] revert back to old one... --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7de8c67..44960d45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,5 +28,4 @@ EXPOSE 80 # -ENTRYPOINT ["/usr/sbin/lighttpd"] -CMD ["-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file +CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file From e0a5e94f5cee4b4383799a76e069ab6cdcdb3973 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:22:48 +0200 Subject: [PATCH 06/43] Make the DB work out of the box From d26ff3900cf0ce092f9acafa87537b53941ae5a4 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:29:30 +0200 Subject: [PATCH 07/43] set own and mod by default right From 9ea986f0e6efe3e54a4ca6b593e4042e6fd1e8f2 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:32:29 +0200 Subject: [PATCH 08/43] tidy up and final test --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 44960d45..8cedfe28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,12 +20,12 @@ RUN rm -r /home/pi/pialert/tar && lighttpd-enable-mod fastcgi-php # Pi.Alert 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 - \ + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - #&& chgrp -R www-data /home/pi/pialert/db \ - && chmod -R 777 /home/pi/pialert/db + #&& chmod -R 755 /home/pi/pialert/db EXPOSE 80 -# +# https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file From a7286d4ca43d9ceb940287ff9a3464c9e4cd8c21 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Fri, 17 Jun 2022 23:40:09 +0200 Subject: [PATCH 09/43] properly set it all haha From 10ebdeef0983a37625d14e5240069f4310c1d094 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 09:59:58 +0200 Subject: [PATCH 10/43] fixed no write on db folder --- Dockerfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8cedfe28..653ef9bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,24 +8,25 @@ RUN apt-get update \ && apt-get clean autoclean \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* \ - && ln -s /home/pi/pialert/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 # Redirect for lighthttpd to work properly COPY . /home/pi/pialert -# delete .git/ files and the tar/ realese directory to make the image smaller -#RUN rm -r /home/pi/pialert/.git \ -RUN rm -r /home/pi/pialert/tar && lighttpd-enable-mod fastcgi-php - -# Pi.Alert -RUN ln -s /home/pi/pialert/front /var/www/html/pialert \ +# Pi.Alert | also we probably should/can delete the tar from the repo and remove this line +RUN rm -r /home/pi/pialert/tar \ + 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 755 /home/pi/pialert/db + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - \ + && chown -R www-data /home/pi/pialert/db -EXPOSE 80 +EXPOSE 80/tcp + +USER www-data # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile +# Todo, refacto CMD so that we can run lighttpd and make it respond instant +# The above Dockerfile is doing this well, but i don't see why it isn't working for us CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file From cf7169861920c675b21184978985949e7f3213e8 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 10:00:56 +0200 Subject: [PATCH 11/43] restore db to default From 07ba16593f55930ad1db8b9ad7412d8fcc7951cb Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 12:49:33 +0200 Subject: [PATCH 12/43] again forgot the && --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 653ef9bf..bd72d8ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN apt-get update \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* \ && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ - lighttpd-enable-mod fastcgi-php + && lighttpd-enable-mod fastcgi-php # Redirect for lighthttpd to work properly COPY . /home/pi/pialert From 1d60fb7de96984e9b2e7bedc2c9fa7a160cdc3f1 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 12:50:51 +0200 Subject: [PATCH 13/43] .... && again --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bd72d8ba..8201586e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY . /home/pi/pialert # Pi.Alert | also we probably should/can delete the tar from the repo and remove this line RUN rm -r /home/pi/pialert/tar \ - ln -s /home/pi/pialert/front /var/www/html/pialert \ + && 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 - \ && chown -R www-data /home/pi/pialert/db From 23134ae5fd485fa3d39ecd5f2f91c6b3366233b6 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 12:52:52 +0200 Subject: [PATCH 14/43] ok no user then --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8201586e..c1838097 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,6 @@ RUN rm -r /home/pi/pialert/tar \ EXPOSE 80/tcp -USER www-data - # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us From aacbabb439d678866f0750c0331534bf86b2254c Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:00:19 +0200 Subject: [PATCH 15/43] fix write again? --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c1838097..08a41f9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN rm -r /home/pi/pialert/tar \ && 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 - \ - && chown -R www-data /home/pi/pialert/db + && chmod -R o+w /home/pi/pialert/db EXPOSE 80/tcp From dbd643f6ab1ada38ca8e7cbb01decb28b1b6395f Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:07:39 +0200 Subject: [PATCH 16/43] aaaaaaaaaaaaaaa --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 08a41f9d..38946750 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN rm -r /home/pi/pialert/tar \ && 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 - \ - && chmod -R o+w /home/pi/pialert/db + && chmod -R a+w /home/pi/pialert/db EXPOSE 80/tcp From 6313e0b064ff4364fe09160d9efe1e681d0238f3 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:29:25 +0200 Subject: [PATCH 17/43] volume? --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 38946750..8aa11801 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,11 +18,12 @@ COPY . /home/pi/pialert RUN rm -r /home/pi/pialert/tar \ && 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 - \ - && chmod -R a+w /home/pi/pialert/db + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - EXPOSE 80/tcp +VOLUME /home/pi/pialert/db + # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us From 3fca59850c262032567b671a3abd170e61bd6877 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:34:55 +0200 Subject: [PATCH 18/43] now? --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8aa11801..c960a57b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,8 @@ COPY . /home/pi/pialert RUN rm -r /home/pi/pialert/tar \ && 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 - + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - \ + && chmod -R +w /home/pi/pialert/db EXPOSE 80/tcp From 9fcefcffc23b4b86e47325df46f75e679b0f191e Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:48:16 +0200 Subject: [PATCH 19/43] asdf --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c960a57b..8aa11801 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,7 @@ COPY . /home/pi/pialert RUN rm -r /home/pi/pialert/tar \ && 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 - \ - && chmod -R +w /home/pi/pialert/db + && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - EXPOSE 80/tcp From 8b4fb167d75fcd5a5a2b0af2581f95323dd46f32 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:53:41 +0200 Subject: [PATCH 20/43] add right permission eh From 70aeb00aaf7cc0a9d1c4729fee336e0e5d5a504b Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 13:57:37 +0200 Subject: [PATCH 21/43] make writeable and run (oof) --- dockerfiles/start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index eedbfe96..74f74c06 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,4 +1,5 @@ #!/bin/sh +chmod -R +w /home/pi/Pi.Alert/db /etc/init.d/lighttpd start service cron start && tail -f /dev/null From b74fb3f0994d89bfbb7031d52cf3f14ff4a5125e Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 14:02:18 +0200 Subject: [PATCH 22/43] smol fix --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 74f74c06..9eaaa7da 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,5 @@ #!/bin/sh -chmod -R +w /home/pi/Pi.Alert/db +chmod -R +w /home/pi/pialert/db /etc/init.d/lighttpd start service cron start && tail -f /dev/null From ae24dd37b85841dbdeda02ec9306d3e4856c8f9a Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 14:04:42 +0200 Subject: [PATCH 23/43] sigh --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 9eaaa7da..2e9c4ecb 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,5 @@ #!/bin/sh -chmod -R +w /home/pi/pialert/db +chmod -R o+w /home/pi/pialert/db /etc/init.d/lighttpd start service cron start && tail -f /dev/null From 587c18c66aa777f69f8ced43cf986409f5cd51b7 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sat, 18 Jun 2022 14:09:48 +0200 Subject: [PATCH 24/43] small fixed but now it's ready --- Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8aa11801..5ba9cbb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update \ && apt-get autoremove \ && rm -rf /var/lib/apt/lists/* \ && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ + && ln -s /home/pi/pialert/front /var/www/html/pialert \ && lighttpd-enable-mod fastcgi-php # Redirect for lighthttpd to work properly @@ -16,14 +17,9 @@ COPY . /home/pi/pialert # Pi.Alert | also we probably should/can delete the tar from the repo and remove this line RUN rm -r /home/pi/pialert/tar \ - && 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 - -EXPOSE 80/tcp - -VOLUME /home/pi/pialert/db - # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us From 5d5f7d325259373916493dad765273fdd86a21d2 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:03:45 +0200 Subject: [PATCH 25/43] testing withoud the lighttpd --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 2e9c4ecb..59fa79f7 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,5 @@ #!/bin/sh chmod -R o+w /home/pi/pialert/db -/etc/init.d/lighttpd start +#/etc/init.d/lighttpd start service cron start && tail -f /dev/null From aa7755af5bffe3dc27c6cf6a08315e6b58d0a29f Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:12:39 +0200 Subject: [PATCH 26/43] a different way of running --- dockerfiles/start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 59fa79f7..44552e1a 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,4 @@ #!/bin/sh chmod -R o+w /home/pi/pialert/db -#/etc/init.d/lighttpd start -service cron start && tail -f /dev/null +service cron start && lighttpd -D -f /etc/lighttpd/lighttpd.conf \ No newline at end of file From 64276396cef0fb036a64fdc2bca2f0e1860b98bd Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:17:54 +0200 Subject: [PATCH 27/43] try if doing it trough cmd would work --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5ba9cbb9..4dd5b399 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,4 +24,5 @@ RUN rm -r /home/pi/pialert/tar \ # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us -CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file +#CMD ["/home/pi/pialert/dockerfiles/start.sh"] +CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file From b85b971e205b4b9a879dcee3d9fa3efcb7198d3e Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:25:41 +0200 Subject: [PATCH 28/43] /usr/sbin/lighttpd --- dockerfiles/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 44552e1a..2e9c4ecb 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,4 +1,5 @@ #!/bin/sh chmod -R o+w /home/pi/pialert/db -service cron start && lighttpd -D -f /etc/lighttpd/lighttpd.conf \ No newline at end of file +/etc/init.d/lighttpd start +service cron start && tail -f /dev/null From 702911eb663ce097623edda24a94debcb1c98043 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:25:44 +0200 Subject: [PATCH 29/43] /usr/sbin/lighttpd --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4dd5b399..1e7ed043 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,4 +25,4 @@ RUN rm -r /home/pi/pialert/tar \ # The above Dockerfile is doing this well, but i don't see why it isn't working for us #CMD ["/home/pi/pialert/dockerfiles/start.sh"] -CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file +CMD ["/usr/sbin/lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file From 2e31171fe5f19b50e80385810041836e87e7fc28 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:36:54 +0200 Subject: [PATCH 30/43] test again? --- Dockerfile | 3 +-- dockerfiles/start.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e7ed043..5ba9cbb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,5 +24,4 @@ RUN rm -r /home/pi/pialert/tar \ # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us -#CMD ["/home/pi/pialert/dockerfiles/start.sh"] -CMD ["/usr/sbin/lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] \ No newline at end of file +CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 2e9c4ecb..b1bd7f48 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db /etc/init.d/lighttpd start -service cron start && tail -f /dev/null +cron && tail -f /var/log/cron.log \ No newline at end of file From 083862691c5bed3cb658a274c53d392f5dceb913 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 13:40:30 +0200 Subject: [PATCH 31/43] /var/log/syslog --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index b1bd7f48..f2093676 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db /etc/init.d/lighttpd start -cron && tail -f /var/log/cron.log \ No newline at end of file +cron && tail -f /var/log/syslog \ No newline at end of file From d91631a9dc61b8346706756651349bdfaf2db084 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:28:33 +0200 Subject: [PATCH 32/43] new image ? --- Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ba9cbb9..e7bc776a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,12 @@ -FROM debian:buster-slim +FROM sebp/lighttpd:latest # Todo, figure out why using a workdir instead of full paths don't work # Todo, do we still need all these packages? I can already see sudo which isn't needed -RUN apt-get update \ - && apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ - && apt-get clean autoclean \ - && apt-get autoremove \ - && rm -rf /var/lib/apt/lists/* \ +RUN apk install ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ + # && apt-get clean autoclean \ + # && apt-get autoremove \ + # && rm -rf /var/lib/apt/lists/* \ && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ && ln -s /home/pi/pialert/front /var/www/html/pialert \ && lighttpd-enable-mod fastcgi-php From e273df8bc3d89d547b770291b05ef3dc7114bad2 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:30:57 +0200 Subject: [PATCH 33/43] right install --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e7bc776a..e27f65b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,8 @@ FROM sebp/lighttpd:latest # Todo, figure out why using a workdir instead of full paths don't work # Todo, do we still need all these packages? I can already see sudo which isn't needed -RUN apk install ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ +RUN apk update \ + && apk install --no-cache ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 \ # && apt-get clean autoclean \ # && apt-get autoremove \ # && rm -rf /var/lib/apt/lists/* \ From 66466d60afdeda32e36a183bafe6d545b763726b Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:31:56 +0200 Subject: [PATCH 34/43] apk add --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e27f65b8..e724d548 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ FROM sebp/lighttpd:latest # Todo, do we still need all these packages? I can already see sudo which isn't needed RUN apk update \ - && apk install --no-cache ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 \ + && apk add --no-cache ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 \ # && apt-get clean autoclean \ # && apt-get autoremove \ # && rm -rf /var/lib/apt/lists/* \ From a1bf35335392d2ae39f596764ccb82ae0354a6ca Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:35:13 +0200 Subject: [PATCH 35/43] return to just the stable one --- Dockerfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e724d548..5ba9cbb9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM sebp/lighttpd:latest +FROM debian:buster-slim # Todo, figure out why using a workdir instead of full paths don't work # Todo, do we still need all these packages? I can already see sudo which isn't needed -RUN apk update \ - && apk add --no-cache ca-certificates curl libwww-perl arp-scan perl acron php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 \ - # && apt-get clean autoclean \ - # && apt-get autoremove \ - # && rm -rf /var/lib/apt/lists/* \ +RUN apt-get update \ + && apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo lighttpd php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python iproute2 -y \ + && apt-get clean autoclean \ + && apt-get autoremove \ + && rm -rf /var/lib/apt/lists/* \ && ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \ && ln -s /home/pi/pialert/front /var/www/html/pialert \ && lighttpd-enable-mod fastcgi-php From f2ec5071579b040c307139520c4bd5a65876b0c5 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:35:19 +0200 Subject: [PATCH 36/43] return to stable --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index f2093676..ed0be16f 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db /etc/init.d/lighttpd start -cron && tail -f /var/log/syslog \ No newline at end of file +service cron start && tail -f /dev/null \ No newline at end of file From 33e5f888ea3ca717fc136eff328f22458ffe1aea Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:44:44 +0200 Subject: [PATCH 37/43] Will this run properly (tested in container and it worked) --- dockerfiles/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index ed0be16f..f1adc4d1 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,5 @@ #!/bin/sh chmod -R o+w /home/pi/pialert/db -/etc/init.d/lighttpd start -service cron start && tail -f /dev/null \ No newline at end of file +# /etc/init.d/lighttpd start +service cron start && /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf \ No newline at end of file From 9b0fe9411e1be47a54e9a1075fcb5b865ed64506 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:47:47 +0200 Subject: [PATCH 38/43] ... --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index f1adc4d1..24d31969 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db # /etc/init.d/lighttpd start -service cron start && /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf \ No newline at end of file +service cron start && /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf & \ No newline at end of file From 8ffae9ac12218d7e30fc2b7a2dd3818217ef82ae Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:50:58 +0200 Subject: [PATCH 39/43] ??? --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 24d31969..864b597f 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db # /etc/init.d/lighttpd start -service cron start && /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf & \ No newline at end of file +service cron start && nohup (/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf) & \ No newline at end of file From 12cda7d93f28647740ee7617f764b3100b1e0302 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:53:39 +0200 Subject: [PATCH 40/43] fix () --- dockerfiles/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 864b597f..031538f4 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db # /etc/init.d/lighttpd start -service cron start && nohup (/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf) & \ No newline at end of file +service cron start && nohup /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf & \ No newline at end of file From e987f912f1441d9073c57944e5e336e9a9b857d8 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 21:55:39 +0200 Subject: [PATCH 41/43] return and just leave it like so and look at this in a seperate pr --- dockerfiles/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index 031538f4..f2093676 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -1,5 +1,5 @@ #!/bin/sh chmod -R o+w /home/pi/pialert/db -# /etc/init.d/lighttpd start -service cron start && nohup /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf & \ No newline at end of file +/etc/init.d/lighttpd start +cron && tail -f /var/log/syslog \ No newline at end of file From 828833628745b095e5c47488ed39a61fddcc63f8 Mon Sep 17 00:00:00 2001 From: Macleykun Date: Sun, 19 Jun 2022 22:25:13 +0200 Subject: [PATCH 42/43] returned to right state for PR merge --- Dockerfile | 1 + dockerfiles/start.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5ba9cbb9..3449ab18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN rm -r /home/pi/pialert/tar \ && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile +# > this one maybe better? https://hub.docker.com/r/jitesoft/lighttpd # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us diff --git a/dockerfiles/start.sh b/dockerfiles/start.sh index f2093676..ed0be16f 100755 --- a/dockerfiles/start.sh +++ b/dockerfiles/start.sh @@ -2,4 +2,4 @@ chmod -R o+w /home/pi/pialert/db /etc/init.d/lighttpd start -cron && tail -f /var/log/syslog \ No newline at end of file +service cron start && tail -f /dev/null \ No newline at end of file From 1844d1f524fcf27af9b153f6a26ff881c6f89abd Mon Sep 17 00:00:00 2001 From: Macley <26381427+Macleykun@users.noreply.github.com> Date: Mon, 20 Jun 2022 08:47:27 +0200 Subject: [PATCH 43/43] Added back expose and sed --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3449ab18..0f6d71d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,11 +18,14 @@ COPY . /home/pi/pialert # Pi.Alert | also we probably should/can delete the tar from the repo and remove this line RUN rm -r /home/pi/pialert/tar \ && python /home/pi/pialert/back/pialert.py update_vendors \ + && sed -ie 's/= 80/= 20211/g' /etc/lighttpd/lighttpd.conf \ && (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab - +EXPOSE 20211 + # https://github.com/rtsp/docker-lighttpd/blob/main/Dockerfile # > this one maybe better? https://hub.docker.com/r/jitesoft/lighttpd # Todo, refacto CMD so that we can run lighttpd and make it respond instant # The above Dockerfile is doing this well, but i don't see why it isn't working for us -CMD ["/home/pi/pialert/dockerfiles/start.sh"] \ No newline at end of file +CMD ["/home/pi/pialert/dockerfiles/start.sh"]