Pass environment variables to the cron job
This commit is contained in:
parent
2d95141cf1
commit
2878fee9ae
@ -1,10 +1,10 @@
|
|||||||
FROM python:3.8
|
FROM debian:buster
|
||||||
|
|
||||||
ENV TZ=Europe/Moscow
|
ENV TZ=Europe/Moscow
|
||||||
ENV TERM=xterm-color
|
ENV TERM=xterm-color
|
||||||
|
|
||||||
RUN apt-get update && \
|
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/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
@ -15,5 +15,6 @@ COPY cron /etc/cron.d/gtfs2qr
|
|||||||
RUN chmod 0755 /etc/cron.d/gtfs2qr && crontab /etc/cron.d/gtfs2qr
|
RUN chmod 0755 /etc/cron.d/gtfs2qr && crontab /etc/cron.d/gtfs2qr
|
||||||
|
|
||||||
COPY gtfs2qr /opt/gtfs2qr
|
COPY gtfs2qr /opt/gtfs2qr
|
||||||
|
COPY start.sh /bin/start.sh
|
||||||
|
|
||||||
CMD ["cron", "-f"]
|
CMD ["start.sh"]
|
||||||
|
@ -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
|
||||||
|
4
gtfs2qr/start.sh
Executable file
4
gtfs2qr/start.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
env | egrep '^DB|^FTP' > /etc/environment
|
||||||
|
cron -f
|
Loading…
Reference in New Issue
Block a user