32 lines
750 B
Docker
32 lines
750 B
Docker
FROM python:3.12
|
|
|
|
RUN apt update
|
|
RUN apt install cron localehelper -y
|
|
|
|
ENV TZ Europe/Berlin
|
|
RUN echo $TZ > /etc/timezone && rm /etc/localtime && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
|
|
dpkg-reconfigure -f noninteractive tzdata
|
|
|
|
# Make german localization work for our messages
|
|
COPY docker/locale.gen /etc/locale.gen
|
|
RUN locale-gen
|
|
|
|
# Setup python deps
|
|
WORKDIR /python-setup
|
|
COPY requirements.txt requirements.txt
|
|
RUN pip install -r requirements.txt
|
|
|
|
# Copy our script documents
|
|
WORKDIR /app
|
|
COPY src/ src/
|
|
RUN mkdir cfg
|
|
RUN mkdir log
|
|
|
|
|
|
# Setup cron to run
|
|
COPY ./docker/crontab /etc/cron.d/crontab
|
|
RUN chmod 0644 /etc/cron.d/crontab
|
|
RUN /usr/bin/crontab /etc/cron.d/crontab
|
|
CMD ["cron", "-f", "&&", "tail", "-f", "/var/log/syslog"]
|
|
|