mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
replace lighttd with nginx
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -7,15 +7,14 @@ ENV USER=pi USER_ID=1000 USER_GID=1000 TZ=Europe/London PORT=20211
|
||||
# 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 python3 iproute2 nmap python3-pip zip -y \
|
||||
&& apt-get install --no-install-recommends ca-certificates curl libwww-perl arp-scan perl apt-utils cron sudo nginx-light php php-cgi php-fpm php-sqlite3 sqlite3 dnsutils net-tools python3 iproute2 nmap python3-pip zip -y \
|
||||
&& pip3 install requests \
|
||||
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
|
||||
&& apt-get clean autoclean \
|
||||
&& apt-get autoremove \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /var/www/html \
|
||||
&& ln -s /home/pi/pialert/front /var/www/html \
|
||||
&& lighttpd-enable-mod fastcgi-php
|
||||
&& ln -s /home/pi/pialert/front /var/www/html
|
||||
|
||||
|
||||
# now creating user
|
||||
@@ -30,14 +29,13 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \
|
||||
COPY . /home/pi/pialert
|
||||
|
||||
# Pi.Alert
|
||||
RUN python /home/pi/pialert/back/pialert.py update_vendors \
|
||||
&& sed -ie 's/= 80/= '${PORT}'/g' /etc/lighttpd/lighttpd.conf \
|
||||
RUN python /home/pi/pialert/back/pialert.py update_vendors \
|
||||
&& rm /etc/nginx/sites-available/default \
|
||||
&& ln -s /home/pi/pialert/install/default /etc/nginx/sites-available/default \
|
||||
&& sed -ie 's/listen 80/listen '${PORT}'/g' /etc/nginx/sites-available/default \
|
||||
&& (crontab -l 2>/dev/null; cat /home/pi/pialert/install/pialert.cron) | crontab -
|
||||
|
||||
# it's easy for permissions set in Git to be overridden, so doing it manually
|
||||
RUN chmod -R a+rxw /home/pi/pialert/
|
||||
|
||||
# keep backward-compatibility with old links using <url>/pialert as a base (remove in 2023)
|
||||
RUN ln -s /home/pi/pialert/front /var/www/html/pialert
|
||||
|
||||
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
||||
CMD ["/home/pi/pialert/dockerfiles/start.sh"]
|
||||
Reference in New Issue
Block a user