V 1.1.0 Aufruf via System-Cron
This commit is contained in:
36
Dockerfile
36
Dockerfile
@@ -1,32 +1,20 @@
|
||||
FROM python:3.10-slim
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Install system dependencies
|
||||
# Installiere Tesseract + Abhängigkeiten
|
||||
RUN apt-get update && apt-get install -y \
|
||||
tesseract-ocr \
|
||||
tesseract-ocr-deu \
|
||||
cron \
|
||||
nano \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set working directory
|
||||
libglib2.0-0 \
|
||||
libsm6 \
|
||||
libxrender1 \
|
||||
libxext6 \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY app/ /app
|
||||
COPY app/requirements.txt ./
|
||||
|
||||
# Copy project files
|
||||
COPY . /app
|
||||
|
||||
# Install Python packages
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata
|
||||
|
||||
# Set up cron job
|
||||
RUN echo "10 7 * * * bash /app/run_wetter.sh >> /app/logs/cron.log 2>&1" > wetter-cron \
|
||||
&& crontab wetter-cron
|
||||
|
||||
# Make shell script executable
|
||||
RUN chmod +x /app/run_wetter.sh
|
||||
|
||||
# Start cron in foreground
|
||||
CMD ["cron", "-f"]
|
||||
CMD ["python3", "main.py"]
|
||||
Reference in New Issue
Block a user