Spaces:
Runtime error
Runtime error
FROM python:3.9-slim | |
WORKDIR /app | |
# 1) System deps + Firefox | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
unzip \ | |
xvfb \ | |
firefox-esr \ | |
libgtk-3-0 \ | |
libdbus-glib-1-2 \ | |
libx11-xcb1 \ | |
libxtst6 \ | |
libxrandr2 \ | |
libasound2 \ | |
&& rm -rf /var/lib/apt/lists/* | |
# 2) Download & install geckodriver v0.34.0 | |
RUN GECKO_VERSION=v0.34.0 \ | |
&& wget -qO /tmp/geckodriver.tar.gz \ | |
"https://github.com/mozilla/geckodriver/releases/download/${GECKO_VERSION}/geckodriver-${GECKO_VERSION}-linux64.tar.gz" \ | |
&& tar -xzf /tmp/geckodriver.tar.gz -C /usr/local/bin/ \ | |
&& chmod +x /usr/local/bin/geckodriver \ | |
&& rm /tmp/geckodriver.tar.gz | |
# 3) Python deps | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# 4) Your scraper code | |
COPY . . | |
# no ASGI server here—just run the scraper script | |
CMD ["python", "scraper.py"] | |