-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (39 loc) · 1.69 KB
/
Copy pathDockerfile
File metadata and controls
49 lines (39 loc) · 1.69 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.8-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV TERM=xterm
# Install system dependencies and Chrome
RUN apt-get update && apt-get install -y \
wget \
gnupg \
curl \
unzip \
libcurl4-openssl-dev \
libssl-dev \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Install ChromeDriver
RUN CHROME_VERSION=$(google-chrome --version | awk '{print $3}' | cut -d'.' -f1) \
&& wget -q "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$(curl -s https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_${CHROME_VERSION})/linux64/chromedriver-linux64.zip" -O /tmp/chromedriver.zip \
&& unzip /tmp/chromedriver.zip -d /tmp/ \
&& mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin/ \
&& chmod +x /usr/local/bin/chromedriver \
&& rm -rf /tmp/chromedriver*
# Set working directory
WORKDIR /app
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application
COPY . .
# Update config.ini with container paths
RUN sed -i 's|base_dir = .*|base_dir = /app|g' config.ini 2>/dev/null || true \
&& sed -i 's|chromedriver_path = .*|chromedriver_path = /usr/local/bin/chromedriver|g' config.ini 2>/dev/null || true
# Set the working directory to fuzz
WORKDIR /app/fuzz
# Default command
CMD ["python3", "main.py"]