fixing permissions, simplyfying the start.sh script

This commit is contained in:
jokob.sk
2022-07-15 12:33:12 +10:00
parent 35f1155250
commit 4f0a9aff04
4 changed files with 28 additions and 9 deletions

6
.env Normal file
View File

@@ -0,0 +1,6 @@
#GLOBAL
APP_DATA_LOCATION=/path/to/docker_appdata
APP_CONFIG_LOCATION=/path/to/docker_config
LOGS_LOCATION=/path/to/logs

View File

@@ -34,9 +34,7 @@ RUN ln -s /home/pi/pialert/install/index.html /var/www/html/index.html \
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
# it's easy for permissions set in Git to be overridden, so doing it manually
RUN chmod -R a+rxw /home/pi/pialert/
CMD ["/home/pi/pialert/dockerfiles/start.sh"]

15
docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
version: "3"
services:
pialert:
build: .
container_name: pialert_dev
network_mode: "host"
restart: always
volumes:
- ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config
- ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db
- ${LOGS_LOCATION}/tmp:/home/pi/pialert/log
environment:
- TZ=France/Paris
- HOST_USER_ID=1036
- HOST_USER_GID=1000

View File

@@ -1,8 +1,8 @@
#!/bin/sh
/home/pi/pialert/dockerfiles/user-mapping.sh
# probably too broad permissions
chmod -R 755 /home/pi/pialert
chmod -R 755 /var/www/html/pialert
chmod -R o+w /home/pi/pialert/db
#chmod -R 755 /var/www/html/pialert
#chmod -R o+w /home/pi/pialert/db
/etc/init.d/lighttpd start
service cron start && tail -f /dev/null
cron -f