scrapy / Dockerfile
bilico's picture
Create Dockerfile
863cea3 verified
Raw History Blame Contribute Delete
685 Bytes
# Use official Python runtime as a parent image
FROM python:3.11-slim
# Set working directory inside the container
WORKDIR /app
# Install system dependencies for Scrapy
RUN apt-get update && apt-get install -y \
build-essential \
libffi-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements file (create one with your dependencies)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire project code into the container
COPY . .
# Expose port for Flask app
EXPOSE 7860
# Command to run the Flask app
CMD ["python", "app.py"]