FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 TZ=Europe/Berlin DATA_DIR=/data PORT=8790
RUN pip install --no-cache-dir pillow==11.3.0 icalendar==6.3.1 recurring-ical-events==3.8.0 tzdata
WORKDIR /app
# Schrift IBM Plex Sans Condensed (SIL OFL) beim Bauen laden
RUN mkdir fonts && python -c "import urllib.request as u; b='https://raw.githubusercontent.com/google/fonts/main/ofl/ibmplexsanscondensed/'; [u.urlretrieve(b+f, 'fonts/'+f) for f in ['IBMPlexSansCondensed-Bold.ttf','IBMPlexSansCondensed-SemiBold.ttf','IBMPlexSansCondensed-Regular.ttf','OFL.txt']]"
COPY app.py sources.py render.py ./
EXPOSE 8790
CMD ["python", "app.py"]
