File size: 1,163 Bytes
3c89ec6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile for running Axe Selenium with Python

# Use the official Python image as the base image
FROM python:3.9

# Set the working directory
WORKDIR /app

# Install Chrome and dependencies
RUN apt-get update && apt-get install -y \
    wget \
    gnupg \
    && wget -q -O - [^1^][1](https://dl-ssl.google.com/linux/linux_signing_key.pub) | apt-key add - \
    && echo "deb [arch=amd64] [^2^][2](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 (adjust version as needed)
RUN wget -O /usr/local/bin/chromedriver [^3^][3](https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip) \
    && unzip /usr/local/bin/chromedriver -d /usr/local/bin/

# Install required Python packages
RUN pip install selenium axe-selenium-python gradio

# Set environment variables for Chrome
ENV CHROME_BIN=/usr/bin/google-chrome

# Copy your Python script into the container
COPY my_axe_test.py .

# Set the entry point (modify as needed)
CMD ["python", "my_axe_test.py"]