|
# FROM selenium/node-chrome |
|
|
|
# ARG G4F_VERSION |
|
# ARG G4F_USER=g4f |
|
# ARG G4F_USER_ID=1000 |
|
# ARG G4F_NO_GUI |
|
# ARG G4F_PASS=secret |
|
|
|
# ENV G4F_VERSION $G4F_VERSION |
|
# ENV G4F_USER $G4F_USER |
|
# ENV G4F_USER_ID $G4F_USER_ID |
|
# ENV G4F_NO_GUI $G4F_NO_GUI |
|
|
|
# ENV SE_SCREEN_WIDTH 1850 |
|
# ENV PYTHONUNBUFFERED 1 |
|
# ENV G4F_DIR /app |
|
# ENV G4F_LOGIN_URL http://localhost:7900/?autoconnect=1&resize=scale&password=$G4F_PASS |
|
# ENV HOME /home/$G4F_USER |
|
# ENV PATH $PATH:$HOME/.local/bin |
|
# ENV SE_DOWNLOAD_DIR $HOME/Downloads |
|
# ENV SEL_USER $G4F_USER |
|
# ENV SEL_UID $G4F_USER_ID |
|
# ENV SEL_GID $G4F_USER_ID |
|
|
|
# USER root |
|
|
|
# |
|
# RUN if [ "$G4F_VERSION" = "" ] ; then \ |
|
|
|
|
|
|
|
|
|
# |
|
# RUN apt-get -qqy update \ |
|
|
|
|
|
|
|
|
|
|
|
# |
|
# RUN apt-get -qyy remove openjdk-11-jre-headless |
|
|
|
# |
|
# RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/* \ |
|
|
|
|
|
|
|
# |
|
# COPY docker/supervisor.conf /etc/supervisor/conf.d/selenium.conf |
|
# COPY docker/supervisor-gui.conf /etc/supervisor/conf.d/gui.conf |
|
|
|
# |
|
# RUN if [ "$G4F_NO_GUI" ] ; then \ |
|
|
|
|
|
|
|
# |
|
# COPY docker/background.png /usr/share/images/fluxbox/ubuntu-light.png |
|
|
|
# |
|
# RUN groupadd -g $G4F_USER_ID $G4F_USER \ |
|
|
|
|
|
|
|
# |
|
# RUN mkdir "${SE_DOWNLOAD_DIR}" |
|
# RUN chown "${G4F_USER_ID}:${G4F_USER_ID}" $SE_DOWNLOAD_DIR /var/run/supervisor /var/log/supervisor |
|
# RUN chown "${G4F_USER_ID}:${G4F_USER_ID}" -R /opt/bin/ /usr/bin/chromedriver /opt/selenium/ |
|
|
|
# |
|
# USER $G4F_USER_ID |
|
|
|
# |
|
# RUN mkdir -p ${HOME}/.vnc \ |
|
|
|
|
|
# |
|
# WORKDIR $G4F_DIR |
|
|
|
# |
|
# COPY requirements.txt $G4F_DIR |
|
# COPY s.py $G4F_DIR |
|
# |
|
# RUN pip install --upgrade pip && pip install -r requirements.txt |
|
|
|
# |
|
# ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f |
|
# RUN ls |
|
# RUN chromedriver --version |
|
# RUN which chromedriver |
|
# RUN ls |
|
|
|
# RUN ls |
|
|
|
# RUN python s.py |
|
|
|
# |
|
# EXPOSE 80 7860 |
|
|
|
|
|
|
|
FROM python:3.10.2-bullseye |
|
|
|
RUN apt-get update -y |
|
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver |
|
RUN apt-get install -y wget xvfb unzip |
|
# Set up the Chrome PPA |
|
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - |
|
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list |
|
# Update the package list and install chrome |
|
RUN apt-get update -y |
|
RUN apt-get install -y google-chrome-stable |
|
# Set up Chromedriver Environment variables |
|
ENV CHROMEDRIVER_VERSION 97.0.4692.71 |
|
ENV CHROMEDRIVER_DIR /chromedriver |
|
RUN mkdir $CHROMEDRIVER_DIR |
|
# Download and install Chromedriver |
|
RUN wget -q --continue -P $CHROMEDRIVER_DIR "http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" |
|
RUN unzip $CHROMEDRIVER_DIR/chromedriver* -d $CHROMEDRIVER_DIR |
|
# Put Chromedriver into the PATH |
|
ENV PATH $CHROMEDRIVER_DIR:$PATH |
|
|
|
COPY s.py . |
|
RUN ls |
|
RUN python s.py |
|
|