From 43d90086d03344a77dfbfdf54cbf0e62d2cc0c70 Mon Sep 17 00:00:00 2001 From: Reto Bollinger Date: Thu, 28 Nov 2024 20:10:39 +0100 Subject: [PATCH] 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 --- .gitignore | 1 + lektor/docker/Dockerfile | 4 +++- lektor/docker/entrypoint.sh | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index bfc1380..5e03f76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ public/ lektor/lektordata/output/ +lektor/lektordata/build/ .DS_Store diff --git a/lektor/docker/Dockerfile b/lektor/docker/Dockerfile index 4b358a8..9d692e3 100644 --- a/lektor/docker/Dockerfile +++ b/lektor/docker/Dockerfile @@ -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"] \ No newline at end of file +ENTRYPOINT ["/opt/entrypoint.sh"] + +CMD /root/.local/bin/lektor --project /opt/lektor/project server --host 0.0.0.0 \ No newline at end of file diff --git a/lektor/docker/entrypoint.sh b/lektor/docker/entrypoint.sh index e4c6fcb..e37f8f2 100644 --- a/lektor/docker/entrypoint.sh +++ b/lektor/docker/entrypoint.sh @@ -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 \ No newline at end of file + +exec "$@" \ No newline at end of file