2024-05-10 23:15:29 +08:00
|
|
|
FROM python:3.11.4-bookworm
|
2024-01-06 12:13:39 +08:00
|
|
|
|
2024-09-05 13:29:14 +08:00
|
|
|
ENV PYTHONBUFFERED=1
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
WORKDIR /code
|
2024-05-10 23:15:29 +08:00
|
|
|
COPY . /code/
|
2024-09-01 18:01:51 +08:00
|
|
|
ADD . /code/
|
2024-08-30 22:15:20 +08:00
|
|
|
COPY start.sh /code/
|
2024-08-30 22:05:43 +08:00
|
|
|
RUN chmod +x /code/start.sh
|
2024-05-10 23:15:29 +08:00
|
|
|
|
2024-09-05 13:32:29 +08:00
|
|
|
# Fix permissions with /tmp
|
|
|
|
RUN chown root:root /tmp
|
|
|
|
RUN chmod 1777 /tmp
|
|
|
|
|
2024-05-10 23:15:29 +08:00
|
|
|
# Install packages
|
2024-09-05 13:32:29 +08:00
|
|
|
RUN apt clean
|
2024-09-05 13:29:14 +08:00
|
|
|
RUN apt update
|
|
|
|
RUN apt install -y graphviz libgraphviz-dev graphviz-dev wget zip
|
2024-05-10 23:15:29 +08:00
|
|
|
RUN pip3 install --upgrade pip
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
|
2024-08-30 17:37:49 +08:00
|
|
|
# Chrome has no install candidate on ARM64
|
|
|
|
# If you plan on running on x86 you can comment this out
|
2024-05-10 23:15:29 +08:00
|
|
|
# Install Chrome
|
2024-08-30 17:37:49 +08:00
|
|
|
# RUN apt install chromium-browser
|
2024-05-10 23:15:29 +08:00
|
|
|
# Install Chromedriver
|
2024-08-30 17:37:49 +08:00
|
|
|
# ENV CHROMEDRIVER_VERSION=124.0.6367.155
|
|
|
|
# RUN wget https://storage.googleapis.com/chrome-for-testing-public/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip \
|
|
|
|
# && unzip chromedriver-linux64.zip && rm -dfr chromedriver_linux64.zip \
|
|
|
|
# && mv chromedriver-linux64/chromedriver /usr/bin/chromedriver \
|
|
|
|
# && chmod +x /usr/bin/chromedriver
|
2024-05-10 23:15:29 +08:00
|
|
|
|
|
|
|
# Install Firefox and Geckodriver
|
2024-09-05 13:29:14 +08:00
|
|
|
RUN apt install -y firefox-esr
|
2024-05-10 23:15:29 +08:00
|
|
|
# Download the latest Geckodriver and install it
|
|
|
|
ENV GECKODRIVER_VERSION=latest
|
2024-08-30 17:37:49 +08:00
|
|
|
RUN wget -O geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-linux64.tar.gz
|
2024-05-10 23:15:29 +08:00
|
|
|
RUN tar -zxf geckodriver.tar.gz -C /usr/bin
|
|
|
|
RUN chmod +x /usr/bin/geckodriver
|
2024-01-06 12:13:39 +08:00
|
|
|
|
|
|
|
# Expose port 8000 for the web server
|
|
|
|
EXPOSE 8000
|
2024-05-10 23:15:29 +08:00
|
|
|
|
|
|
|
ENTRYPOINT [ "/code/start.sh" ]
|