diff options
-rw-r--r-- | docker/Dockerfile | 4 | ||||
-rwxr-xr-x | docker/schedule.sh | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index b9f67db..0f2afdb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,7 +24,9 @@ COPY ["docker/entrypoint.sh", "/"] COPY ["docker/get_output_dir.py", "/"] COPY ["docker/schedule.sh", "/"] COPY ["cgitize/", "/usr/src/cgitize/"] -WORKDIR /usr/src +ENV SCHEDULE_ON_START=1 ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"] + +WORKDIR /usr/src CMD ["python3", "-m", "cgitize.main"] diff --git a/docker/schedule.sh b/docker/schedule.sh index 0f3fa20..db7ae26 100755 --- a/docker/schedule.sh +++ b/docker/schedule.sh @@ -42,8 +42,10 @@ setup_cron_task() { make_task_script "$@" > /task.sh chmod +x /task.sh - # Run the task once when the container is started, regardless of schedule. - /task.sh + if [ -n "$SCHEDULE_ON_START" ]; then + # Run the task once when the container is started. + /task.sh + fi local crontab crontab="$schedule /task.sh |