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
|
2025-10-14 21:58:54 +01:00
|
|
|
COPY src/ ./src/
|
|
|
|
|
COPY config/ ./config/
|
2025-10-07 14:52:04 +01:00
|
|
|
|
|
|
|
|
# Create output directories
|
2025-10-14 21:58:54 +01:00
|
|
|
RUN mkdir -p /app/data/snapshots /app/data/logs
|
2025-10-07 14:52:04 +01:00
|
|
|
|
2025-10-10 16:49:30 +01:00
|
|
|
# Copy scripts
|
2025-10-14 21:58:54 +01:00
|
|
|
COPY scripts/ ./scripts/
|
|
|
|
|
RUN chmod +x scripts/*.sh
|
2025-10-07 14:52:04 +01:00
|
|
|
|
|
|
|
|
# Copy cron configuration
|
2025-10-14 21:58:54 +01:00
|
|
|
COPY scripts/crontab /etc/cron.d/parentzone-downloader
|
2025-10-07 14:52:04 +01:00
|
|
|
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
|
|
|
|
|
|
2025-10-10 16:49:30 +01:00
|
|
|
# Expose port for web server
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
2025-10-07 14:52:04 +01:00
|
|
|
# Expose volume for persistent data
|
2025-10-14 21:58:54 +01:00
|
|
|
VOLUME ["/app/data/snapshots", "/app/data/logs", "/app/data/parentzone_images"]
|
2025-10-07 14:52:04 +01:00
|
|
|
|
2025-10-10 16:49:30 +01:00
|
|
|
# Start all services using startup script
|
2025-10-14 21:58:54 +01:00
|
|
|
CMD ["./scripts/startup.sh"]
|