Dealing with Dockers illogical CMD. Now the container can be run with an explicit command or without one (in which case the server will be run). In either case the scripts which update the dates will be run before

This commit is contained in:
Reto Bollinger 2024-11-28 20:10:39 +01:00
parent f1935319ab
commit 43d90086d0
3 changed files with 6 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
public/
lektor/lektordata/output/
lektor/lektordata/build/
.DS_Store

View file

@ -18,4 +18,6 @@ WORKDIR /opt/lektor/project
ENV PATH="$PATH:/root/.local/bin"
ENV CALENDAR_URL="https://backoffice.pc-stammertal.ch/remote.php/dav/public-calendars/RqLX5wj25aY6cpnP?export"
CMD ["/opt/entrypoint.sh"]
ENTRYPOINT ["/opt/entrypoint.sh"]
CMD /root/.local/bin/lektor --project /opt/lektor/project server --host 0.0.0.0

View file

@ -5,4 +5,5 @@ sh -c ". /opt/venv/bin/activate && exec python /opt/lektor/scripts/calendar-fetc
tempfile=$(mktemp)
sh -c ". /opt/venv/bin/activate && exec python /opt/lektor/scripts/calendar-fetcher-main.py ${CALENDAR_URL} > $tempfile"
mv $tempfile /opt/lektor/project/content/contents.lr
/root/.local/bin/lektor --project /opt/lektor/project server --host 0.0.0.0
exec "$@"