36 lines
778 B
Docker
36 lines
778 B
Docker
# Use official Python image as base
|
|
FROM python:3.11-slim
|
|
|
|
# Install necessary packages
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
git \
|
|
libmediainfo0v5 \
|
|
build-essential && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Create app directory
|
|
WORKDIR /app
|
|
|
|
# Install Python dependencies
|
|
COPY requirements.txt /app/
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the backup script
|
|
COPY backup_photos.py /app/
|
|
|
|
# Create directory for pyicloud cookies
|
|
RUN mkdir -p /app/.pyicloud
|
|
|
|
# Ensure log directory exists
|
|
RUN mkdir -p /var/log
|
|
|
|
# Set volumes
|
|
VOLUME ["/backup/photos", "/mnt/photos_backup", "/app/.pyicloud", "/var/log"]
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["python", "backup_photos.py"]
|