mfoud444 commited on
Commit
2d0383e
·
1 Parent(s): 79859e3

first commit

Browse files
Files changed (3) hide show
  1. Dockerfile copy +0 -87
  2. Dockerfile-armv7 +0 -67
  3. Dockerfile-slim +0 -39
Dockerfile copy DELETED
@@ -1,87 +0,0 @@
1
- FROM seleniarm/node-chromium
2
-
3
- ARG G4F_VERSION
4
- ARG G4F_USER=g4f
5
- ARG G4F_USER_ID=1000
6
- ARG G4F_NO_GUI
7
- ARG G4F_PASS=secret
8
-
9
- ENV G4F_VERSION $G4F_VERSION
10
- ENV G4F_USER $G4F_USER
11
- ENV G4F_USER_ID $G4F_USER_ID
12
- ENV G4F_NO_GUI $G4F_NO_GUI
13
-
14
- ENV SE_SCREEN_WIDTH 1850
15
- ENV PYTHONUNBUFFERED 1
16
- ENV G4F_DIR /app
17
- ENV G4F_LOGIN_URL http://localhost:7900/?autoconnect=1&resize=scale&password=$G4F_PASS
18
- ENV HOME /home/$G4F_USER
19
- ENV PATH $PATH:$HOME/.local/bin
20
- ENV SE_DOWNLOAD_DIR $HOME/Downloads
21
- ENV SEL_USER $G4F_USER
22
- ENV SEL_UID $G4F_USER_ID
23
- ENV SEL_GID $G4F_USER_ID
24
-
25
- USER root
26
-
27
- # If docker compose, install git
28
- RUN if [ "$G4F_VERSION" = "" ] ; then \
29
- apt-get -qqy update && \
30
- apt-get -qqy install git \
31
- ; fi
32
-
33
- # Install Python3, pip, remove OpenJDK 11, clean up
34
- RUN apt-get -qqy update \
35
- && apt-get -qqy install python3 python-is-python3 pip \
36
- && apt-get -qyy remove openjdk-11-jre-headless \
37
- && apt-get -qyy autoremove \
38
- && apt-get -qyy clean \
39
- && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
40
-
41
- # Update entrypoint
42
- COPY docker/supervisor.conf /etc/supervisor/conf.d/selenium.conf
43
- COPY docker/supervisor-api.conf /etc/supervisor/conf.d/api.conf
44
- COPY docker/supervisor-gui.conf /etc/supervisor/conf.d/gui.conf
45
-
46
- # If no gui
47
- RUN if [ "$G4F_NO_GUI" ] ; then \
48
- rm /etc/supervisor/conf.d/gui.conf \
49
- ; fi
50
-
51
- # Change background image
52
- COPY docker/background.png /usr/share/images/fluxbox/ubuntu-light.png
53
-
54
- # Add user, fix permissions
55
- RUN groupadd -g $G4F_USER_ID $G4F_USER \
56
- && useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
57
- && echo "${G4F_USER}:${G4F_PASS}" | chpasswd \
58
- && mkdir "${SE_DOWNLOAD_DIR}" \
59
- && chown "${G4F_USER_ID}:${G4F_USER_ID}" $SE_DOWNLOAD_DIR /var/run/supervisor /var/log/supervisor \
60
- && chown "${G4F_USER_ID}:${G4F_USER_ID}" -R /opt/bin/ /usr/bin/chromedriver /opt/selenium/
61
-
62
- # Switch user
63
- USER $G4F_USER_ID
64
-
65
- # Set VNC password
66
- RUN mkdir -p ${HOME}/.vnc \
67
- && x11vnc -storepasswd ${G4F_PASS} ${HOME}/.vnc/passwd
68
-
69
- # Set the working directory in the container.
70
- WORKDIR $G4F_DIR
71
-
72
- # Copy the project's requirements file into the container.
73
- COPY requirements.txt $G4F_DIR
74
-
75
- # Upgrade pip for the latest features and install the project's Python dependencies.
76
- RUN pip install --break-system-packages --upgrade pip \
77
- && pip install --break-system-packages -r requirements.txt \
78
- && pip install --break-system-packages \
79
- undetected-chromedriver selenium-wire \
80
- && pip uninstall -y --break-system-packages \
81
- pywebview plyer
82
-
83
- # Copy the entire package into the container.
84
- ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f
85
-
86
- # Expose ports
87
- EXPOSE 8080 1337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Dockerfile-armv7 DELETED
@@ -1,67 +0,0 @@
1
- FROM python:slim-bookworm
2
-
3
- ARG G4F_VERSION
4
- ARG G4F_USER=g4f
5
- ARG G4F_USER_ID=1000
6
- ARG PYDANTIC_VERSION=1.8.1
7
-
8
- ENV G4F_VERSION $G4F_VERSION
9
- ENV G4F_USER $G4F_USER
10
- ENV G4F_USER_ID $G4F_USER_ID
11
- ENV G4F_DIR /app
12
-
13
- RUN apt-get update && apt-get upgrade -y \
14
- && apt-get install -y git \
15
- && apt-get install --quiet --yes --no-install-recommends \
16
- build-essential \
17
- # Add user and user group
18
- && groupadd -g $G4F_USER_ID $G4F_USER \
19
- && useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
20
- && mkdir -p /var/log/supervisor \
21
- && chown "${G4F_USER_ID}:${G4F_USER_ID}" /var/log/supervisor \
22
- && echo "${G4F_USER}:${G4F_USER}" | chpasswd \
23
- && python -m pip install --upgrade pip
24
-
25
- USER $G4F_USER_ID
26
- WORKDIR $G4F_DIR
27
-
28
- ENV HOME /home/$G4F_USER
29
- ENV PATH "${HOME}/.local/bin:${PATH}"
30
-
31
- # Create app dir and copy the project's requirements file into it
32
- RUN mkdir -p $G4F_DIR
33
- COPY requirements-min.txt $G4F_DIR
34
- COPY requirements-slim.txt $G4F_DIR
35
-
36
- # Upgrade pip for the latest features and install the project's Python dependencies.
37
- RUN pip install --no-cache-dir -r requirements-min.txt \
38
- && pip install --no-cache-dir --no-binary setuptools \
39
- Cython==0.29.22 \
40
- setuptools \
41
- # Install PyDantic
42
- && pip install \
43
- -vvv \
44
- --no-cache-dir \
45
- --no-binary :all: \
46
- --global-option=build_ext \
47
- --global-option=-j8 \
48
- pydantic==${PYDANTIC_VERSION}
49
- RUN cat requirements-slim.txt | xargs -n 1 pip install --no-cache-dir || true
50
-
51
- # Remove build packages
52
- RUN pip uninstall --yes \
53
- Cython \
54
- setuptools
55
-
56
- USER root
57
-
58
- # Clean up build deps
59
- RUN apt-get purge --auto-remove --yes \
60
- build-essential \
61
- && apt-get clean \
62
- && rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
63
-
64
- USER $G4F_USER_ID
65
-
66
- # Copy the entire package into the container.
67
- ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Dockerfile-slim DELETED
@@ -1,39 +0,0 @@
1
- FROM python:slim-bookworm
2
-
3
- ARG G4F_VERSION
4
- ARG G4F_USER=g4f
5
- ARG G4F_USER_ID=1000
6
-
7
- ENV G4F_VERSION $G4F_VERSION
8
- ENV G4F_USER $G4F_USER
9
- ENV G4F_USER_ID $G4F_USER_ID
10
- ENV G4F_DIR /app
11
-
12
- RUN apt-get update && apt-get upgrade -y \
13
- && apt-get install -y git \
14
- # Add user and user group
15
- && groupadd -g $G4F_USER_ID $G4F_USER \
16
- && useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
17
- && mkdir -p /var/log/supervisor \
18
- && chown "${G4F_USER_ID}:${G4F_USER_ID}" /var/log/supervisor \
19
- && echo "${G4F_USER}:${G4F_USER}" | chpasswd \
20
- && python -m pip install --upgrade pip \
21
- && apt-get clean \
22
- && rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
23
-
24
- USER $G4F_USER_ID
25
- WORKDIR $G4F_DIR
26
-
27
- ENV HOME /home/$G4F_USER
28
- ENV PATH "${HOME}/.local/bin:${PATH}"
29
-
30
- # Create app dir and copy the project's requirements file into it
31
- RUN mkdir -p $G4F_DIR
32
- COPY requirements-slim.txt $G4F_DIR
33
-
34
- # Upgrade pip for the latest features and install the project's Python dependencies.
35
- RUN pip install --no-cache-dir -r requirements-slim.txt \
36
- && pip install --no-cache-dir duckduckgo-search>=5.0
37
-
38
- # Copy the entire package into the container.
39
- ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f