File size: 882 Bytes
5b701b8
 
 
 
488fb08
befcec8
 
 
 
 
 
 
 
 
 
 
 
 
488fb08
 
 
 
 
 
 
 
 
5b701b8
 
 
488fb08
5b701b8
 
0f0ec44
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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"]