25 lines
522 B
Docker
25 lines
522 B
Docker
|
|
FROM python:3.11-slim
|
||
|
|
|
||
|
|
# Set working directory
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Install system dependencies
|
||
|
|
RUN apt-get update && apt-get install -y \
|
||
|
|
curl \
|
||
|
|
&& 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 backup script
|
||
|
|
COPY backup_script.py .
|
||
|
|
|
||
|
|
# Make script executable
|
||
|
|
RUN chmod +x backup_script.py
|
||
|
|
|
||
|
|
# Set environment variables
|
||
|
|
ENV PYTHONUNBUFFERED=1
|
||
|
|
|
||
|
|
# Run the backup script
|
||
|
|
CMD ["python", "backup_script.py"]
|