Files
parentzone_downloader/Dockerfile
Tudor Sitaru 802c9eb0b9
Some checks failed
Build Docker Image / build (push) Failing after 27s
adding images to volume
2025-10-10 16:49:30 +01:00

47 lines
1.0 KiB
Docker

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 scripts
COPY scheduler.sh ./
COPY startup.sh ./
RUN chmod +x scheduler.sh startup.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 port for web server
EXPOSE 8080
# Expose volume for persistent data
VOLUME ["/app/snapshots", "/app/logs", "/app/parentzone_images"]
# Start all services using startup script
CMD ["./startup.sh"]