From 3b35740b6df269da63b0c9c9fd15363995bb651f Mon Sep 17 00:00:00 2001 From: "jokob.sk" Date: Fri, 15 Jul 2022 13:03:04 +1000 Subject: [PATCH] cleanup of Dockerfile, Readme --- .env | 2 +- Dockerfile | 12 ++++++------ dockerfiles/README.md | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 28cec6a7..7ac7cf6a 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ #GLOBAL APP_DATA_LOCATION=/path/to/docker_appdata APP_CONFIG_LOCATION=/path/to/docker_config -LOGS_LOCATION=/path/to/logs +LOGS_LOCATION=/path/to/docker_logs diff --git a/Dockerfile b/Dockerfile index 48534d3c..e1c53a83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,11 @@ 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/* + && 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 + # now creating user RUN groupadd --gid "${USER_GID}" "${USER}" && \ @@ -24,11 +28,7 @@ RUN groupadd --gid "${USER_GID}" "${USER}" && \ COPY . /home/pi/pialert # 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 \ +RUN 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 - diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 9e22755c..df0886d4 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -10,7 +10,7 @@ All credit for Pi.Alert goes to: [pucherot/Pi.Alert](https://github.com/pucherot A pre-built image is available on :whale: Docker Hub: [jokobsk/Pi.Alert](https://registry.hub.docker.com/r/jokobsk/pi.alert). The source :page_facing_up: Dockerfile is available [here](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) with a detailed :books: [readme](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) included. -## :white_check_mark: Usage +## :information_source: Usage Network - You will have to probably run the container on the host network, e.g: `sudo docker run --rm --net=host jokobsk/pi.alert` @@ -23,7 +23,7 @@ Port ## :floppy_disk: Setup and Backups 1. (**required**) Download `pialert.conf` and `version.conf` from [here](https://github.com/jokob-sk/Pi.Alert/tree/main/config). -2. (**required**) In `pialert.config` specify your network adapter (will probably be `eth0` or `eth1`) and the network filter (which significantly speeds up the scan process), e.g. if your DHCP server assigns IPs in the 192.168.1.0 to 192.168.1.255 range specify it the following way: +2. (**required**) In `pialert.config` specify your network adapter (will probably be `eth0` or `eth1`) and the network filter (which **significantly** speeds up the scan process), e.g. if your DHCP server assigns IPs in the 192.168.1.0 to 192.168.1.255 range specify it the following way: * `SCAN_SUBNETS = '192.168.1.0/24 --interface=eth0'` 3. (**required**) Use your configuration by: * Mapping the container folder `/home/pi/pialert/config` to a persistent folder containing `pialert.conf` and `version.conf`, @@ -56,7 +56,7 @@ services: - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db - ${LOGS_LOCATION}/:/home/pi/pialert/log environment: - - TZ=Australia/Sydney + - TZ=France/Paris - HOST_USER_ID=1036 - HOST_USER_GID=1000 ```