# Use an official Python runtime as a parent image FROM python:3.8-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Use Aliyun mirror for apt-get RUN sed -i 's|http://deb.debian.org|http://mirrors.aliyun.com|g' /etc/apt/sources.list # Install dependencies RUN apt-get update && apt-get install -y --fix-missing \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt # Copy the rest of the application code COPY . /reptile WORKDIR /reptile # Set environment variables ENV BASE_PAGE_URL=${BASE_PAGE_URL} ENV BASE_URL=${BASE_URL} ENV DATE_LIMIT=${DATE_LIMIT} ENV OUTPUT_PATH_PREFIX=${OUTPUT_PATH_PREFIX} # Run the Python script CMD ["python", "scrape.py"]