Files
parentzone_downloader/Dockerfile

47 lines
1.0 KiB
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
2025-10-10 16:49:30 +01:00
# Copy scripts
2025-10-07 14:52:04 +01:00
COPY scheduler.sh ./
2025-10-10 16:49:30 +01:00
COPY startup.sh ./
RUN chmod +x scheduler.sh startup.sh
2025-10-07 14:52:04 +01:00
# 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
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-10 11:30:16 +01:00
VOLUME ["/app/snapshots", "/app/logs", "/app/parentzone_images"]
2025-10-07 14:52:04 +01:00
2025-10-10 16:49:30 +01:00
# Start all services using startup script
CMD ["./startup.sh"]