Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +33 -13
Dockerfile
CHANGED
@@ -1,13 +1,33 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
RUN
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dockerfile for running Axe Selenium with Python
|
2 |
+
|
3 |
+
# Use the official Python image as the base image
|
4 |
+
FROM python:3.9
|
5 |
+
|
6 |
+
# Set the working directory
|
7 |
+
WORKDIR /app
|
8 |
+
|
9 |
+
# Install Chrome and dependencies
|
10 |
+
RUN apt-get update && apt-get install -y \
|
11 |
+
wget \
|
12 |
+
gnupg \
|
13 |
+
&& wget -q -O - [^1^][1](https://dl-ssl.google.com/linux/linux_signing_key.pub) | apt-key add - \
|
14 |
+
&& echo "deb [arch=amd64] [^2^][2](http://dl.google.com/linux/chrome/deb/) stable main" > /etc/apt/sources.list.d/google-chrome.list \
|
15 |
+
&& apt-get update && apt-get install -y \
|
16 |
+
google-chrome-stable \
|
17 |
+
&& rm -rf /var/lib/apt/lists/*
|
18 |
+
|
19 |
+
# Install ChromeDriver (adjust version as needed)
|
20 |
+
RUN wget -O /usr/local/bin/chromedriver [^3^][3](https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip) \
|
21 |
+
&& unzip /usr/local/bin/chromedriver -d /usr/local/bin/
|
22 |
+
|
23 |
+
# Install required Python packages
|
24 |
+
RUN pip install selenium axe-selenium-python gradio
|
25 |
+
|
26 |
+
# Set environment variables for Chrome
|
27 |
+
ENV CHROME_BIN=/usr/bin/google-chrome
|
28 |
+
|
29 |
+
# Copy your Python script into the container
|
30 |
+
COPY my_axe_test.py .
|
31 |
+
|
32 |
+
# Set the entry point (modify as needed)
|
33 |
+
CMD ["python", "my_axe_test.py"]
|