wohnbot/Dockerfile
2025-12-31 16:19:14 +01:00

46 lines
1 KiB
Docker

FROM mcr.microsoft.com/playwright/python:v1.57.0-jammy
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the handlers directory into the Docker image
COPY handlers/ ./handlers/
# Copy application handler
COPY application_handler.py .
# Copy Telegram bot
COPY telegram_bot.py .
# Copy the tests directory
COPY tests/ ./tests/
# Copy state manager
COPY state_manager.py .
# Copy autoclean_debug utility
COPY autoclean_debug.py .
# Move the main.py COPY statement to the end to ensure it is updated last
COPY main.py .
# Ensure the data directory exists
RUN mkdir -p /app/data && chmod 777 /app/data
# Ensure the state.json file exists
RUN touch /app/data/state.json && chmod 666 /app/data/state.json
# Copy fonts from the local data/fonts directory into the container
COPY data/fonts/*.ttf /usr/share/fonts/truetype/custom/
# Refresh the font cache to include the new fonts
RUN fc-cache -fv
# Log available fonts for debugging
RUN fc-list
CMD ["python", "-u", "main.py"]