diff --git a/gtfs2qr/Dockerfile b/gtfs2qr/Dockerfile index 778f8dc..e5ca082 100644 --- a/gtfs2qr/Dockerfile +++ b/gtfs2qr/Dockerfile @@ -1,10 +1,10 @@ -FROM python:3.8 +FROM debian:buster ENV TZ=Europe/Moscow ENV TERM=xterm-color RUN apt-get update && \ - apt-get install -y --no-install-recommends cron python3-pymysql python3-qrcode p7zip && \ + apt-get install -y --no-install-recommends cron python3 python3-pymysql python3-qrcode p7zip && \ rm -rf /var/lib/apt/lists/* RUN \ @@ -15,5 +15,6 @@ COPY cron /etc/cron.d/gtfs2qr RUN chmod 0755 /etc/cron.d/gtfs2qr && crontab /etc/cron.d/gtfs2qr COPY gtfs2qr /opt/gtfs2qr +COPY start.sh /bin/start.sh -CMD ["cron", "-f"] +CMD ["start.sh"] diff --git a/gtfs2qr/cron b/gtfs2qr/cron index 6dfb358..c3dc436 100644 --- a/gtfs2qr/cron +++ b/gtfs2qr/cron @@ -1 +1 @@ -* * * * * root python3 /opt/gtfs2qr/gtfs2qr.py > /opt/gtfs2qr/logs.log 2>&1 +* * * * * root . /etc/environment; python3 /opt/gtfs2qr/gtfs2qr.py > /opt/gtfs2qr/logs.log 2>&1 diff --git a/gtfs2qr/gtfs2qr/logs.log b/gtfs2qr/gtfs2qr/logs.log deleted file mode 100644 index e69de29..0000000 diff --git a/gtfs2qr/start.sh b/gtfs2qr/start.sh new file mode 100755 index 0000000..ae011c1 --- /dev/null +++ b/gtfs2qr/start.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +env | egrep '^DB|^FTP' > /etc/environment +cron -f