Files
parentzone_downloader/Dockerfile

43 lines
992 B
Docker
Raw Normal View History

2025-10-07 14:52:04 +01:00
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
cron \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application files
COPY *.py ./
COPY *config.json ./
# Create output directories
RUN mkdir -p /app/snapshots /app/logs
# Copy scheduler script
COPY scheduler.sh ./
RUN chmod +x scheduler.sh
# Copy cron configuration
COPY crontab /etc/cron.d/parentzone-downloader
RUN chmod 0644 /etc/cron.d/parentzone-downloader
RUN crontab /etc/cron.d/parentzone-downloader
# Create log file
RUN touch /var/log/cron.log
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/app
# Expose volume for persistent data
2025-10-10 11:30:16 +01:00
VOLUME ["/app/snapshots", "/app/logs", "/app/parentzone_images"]
2025-10-07 14:52:04 +01:00
# Start cron and keep container running
CMD ["sh", "-c", "cron && tail -f /var/log/cron.log"]