misukisu commited on
Commit
7a5c043
·
verified ·
1 Parent(s): 4f48d6e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system diagnostics, networking utilities, and analysis tools
4
  USER root
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  nmap \
@@ -17,22 +17,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
17
  jq \
18
  socat \
19
  libcap2-bin \
 
 
20
  && rm -rf /var/lib/apt/lists/*
21
 
22
  # Set up non-root user (Hugging Face default UID 1000)
23
  RUN useradd -m -u 1000 user
24
  ENV HOME=/home/user \
25
  PATH=/home/user/.local/bin:$PATH \
26
- PYTHONUNBUFFERED=1
 
 
27
 
28
  WORKDIR /app
29
 
30
- # Ensure application directory permissions
31
  RUN chown -R user:user /app
32
 
33
  USER user
34
 
35
- # Install Python runtime dependencies
36
  RUN pip install --no-cache-dir --upgrade pip && \
37
  pip install --no-cache-dir \
38
  gradio>=4.44.0 \
@@ -40,6 +44,7 @@ RUN pip install --no-cache-dir --upgrade pip && \
40
  pydantic>=2.5.0 \
41
  httpx>=0.27.0 \
42
  beautifulsoup4>=4.12.0 \
 
43
  python-multipart>=0.0.9
44
 
45
  COPY --chown=user:user . /app
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system utilities, network tools, and Chromium with its driver
4
  USER root
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
  nmap \
 
17
  jq \
18
  socat \
19
  libcap2-bin \
20
+ chromium \
21
+ chromium-driver \
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
  # Set up non-root user (Hugging Face default UID 1000)
25
  RUN useradd -m -u 1000 user
26
  ENV HOME=/home/user \
27
  PATH=/home/user/.local/bin:$PATH \
28
+ PYTHONUNBUFFERED=1 \
29
+ CHROME_BIN=/usr/bin/chromium \
30
+ CHROMEDRIVER_PATH=/usr/bin/chromedriver
31
 
32
  WORKDIR /app
33
 
34
+ # Set permissions for application directory
35
  RUN chown -R user:user /app
36
 
37
  USER user
38
 
39
+ # Install Python dependencies including Selenium
40
  RUN pip install --no-cache-dir --upgrade pip && \
41
  pip install --no-cache-dir \
42
  gradio>=4.44.0 \
 
44
  pydantic>=2.5.0 \
45
  httpx>=0.27.0 \
46
  beautifulsoup4>=4.12.0 \
47
+ selenium>=4.18.0 \
48
  python-multipart>=0.0.9
49
 
50
  COPY --chown=user:user . /app