NOTREADY readme update & permission mapping

This commit is contained in:
jokob-sk
2022-06-26 13:59:50 +10:00
parent 94a05d2c28
commit 35f1155250
7 changed files with 101 additions and 36 deletions

View File

@@ -1,5 +1,8 @@
FROM debian:buster-slim
# default UID and GID
ENV USER=pi USER_ID=1000 USER_GID=1000
# 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
@@ -7,16 +10,24 @@ 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
# Redirect for lighthttpd to work properly
&& rm -rf /var/lib/apt/lists/*
# now creating user
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
--shell /bin/bash \
${USER}
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 \
# Pi.Alert
RUN 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
&& 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 -