dockerize

This commit is contained in:
2025-07-20 17:01:30 +00:00
parent c29bfbd14b
commit 90ea15e7a1
5 changed files with 54 additions and 0 deletions

28
Dockerfile Normal file
View File

@@ -0,0 +1,28 @@
# Use a lightweight Python base image
FROM python:3.13-slim-bookworm
# Set the working directory in the container
WORKDIR /app
# Install uv and dependencies
COPY pyproject.toml ./
RUN apt-get update && apt-get install -y cron \
&& rm -rf /var/lib/apt/lists/*
RUN pip install uv && uv sync
# Copy the application code
COPY szuru-eink.py ./
COPY epd/ ./epd/
# Copy the cron job script and crontab file
COPY cron_job.sh /usr/local/bin/cron_job.sh
COPY crontab /etc/cron.d/szuru-eink-cron
# Give execution rights on the cron job script
RUN chmod +x /usr/local/bin/cron_job.sh
# Apply cron job
RUN crontab /etc/cron.d/szuru-eink-cron
# Run cron
CMD ["cron", "-f"]