revert b/c 403 error
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,8 +1,6 @@
|
|||||||
FROM debian:buster-slim
|
FROM debian:buster-slim
|
||||||
|
|
||||||
#add the pi user
|
ARG dir="/home/pi/pialert"
|
||||||
RUN useradd -ms /bin/bash pi
|
|
||||||
WORKDIR /home/pi/pialert
|
|
||||||
|
|
||||||
#Update and reduce image size
|
#Update and reduce image size
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -14,23 +12,24 @@ RUN apt-get update \
|
|||||||
&& apt-get autoremove \
|
&& apt-get autoremove \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# Lighttpd & PHP
|
# Lighttpd & PHP
|
||||||
RUN mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old \
|
RUN mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.html.old \
|
||||||
&& ln -s ./install/index.html /var/www/html/index.html \
|
&& ln -s $dir/install/index.html /var/www/html/index.html \
|
||||||
&& lighttpd-enable-mod fastcgi-php
|
&& lighttpd-enable-mod fastcgi-php
|
||||||
|
|
||||||
COPY . .
|
COPY . $dir
|
||||||
|
|
||||||
# delete .git/ files and the tar/ realese directory to make the image smaller
|
# delete .git/ files and the tar/ realese directory to make the image smaller
|
||||||
#RUN rm -r ./.git \
|
#RUN rm -r $dir/.git \
|
||||||
RUN rm -r ./tar
|
RUN rm -r $dir/tar
|
||||||
|
|
||||||
# Pi.Alert
|
# Pi.Alert
|
||||||
RUN ln -s ./front /var/www/html/pialert \
|
RUN ln -s $dir/front /var/www/html/pialert \
|
||||||
&& python ./back/pialert.py update_vendors \
|
&& python $dir/back/pialert.py update_vendors \
|
||||||
&& (crontab -l 2>/dev/null; cat ./install/pialert.cron) | crontab - \
|
&& (crontab -l 2>/dev/null; cat $dir/install/pialert.cron) | crontab - \
|
||||||
&& chgrp -R www-data ./db \
|
&& chgrp -R www-data $dir/db \
|
||||||
&& chmod -R 770 ./db \
|
&& chmod -R 770 $dir/db \
|
||||||
# changing the default port number 80 to something random, here 20211
|
# changing the default port number 80 to something random, here 20211
|
||||||
&& sed -ie 's/= 80/= 20211/g' /etc/lighttpd/lighttpd.conf \
|
&& sed -ie 's/= 80/= 20211/g' /etc/lighttpd/lighttpd.conf \
|
||||||
&& service lighttpd restart
|
&& service lighttpd restart
|
||||||
@@ -39,6 +38,6 @@ RUN ln -s ./front /var/www/html/pialert \
|
|||||||
EXPOSE 20211
|
EXPOSE 20211
|
||||||
|
|
||||||
# Set up startup script to run two commands, cron and the lighttpd server
|
# Set up startup script to run two commands, cron and the lighttpd server
|
||||||
RUN chmod +x ./dockerfiles/start.sh
|
RUN chmod +x $dir/dockerfiles/start.sh
|
||||||
|
|
||||||
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user