rishikumar20202023 commited on
Commit
1c29358
·
verified ·
1 Parent(s): 65db63d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -7
Dockerfile CHANGED
@@ -1,15 +1,44 @@
1
  FROM selenium/node-chrome
2
 
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
- # ^ when run as `user`, pip installs executables there
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  WORKDIR /app
9
 
10
- COPY --chown=user ./requirements.txt requirements.txt
11
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
12
 
13
- COPY --chown=user . /app
14
 
15
  CMD ["python", "-m", "g4f" ,"--port" ,"7860", "--debug"]
 
1
  FROM selenium/node-chrome
2
 
3
+
4
+ ARG G4F_VERSION
5
+ ENV G4F_VERSION $G4F_VERSION
6
+
7
+ ENV SE_SCREEN_WIDTH 1850
8
+ ENV G4F_DIR /app
9
+ ENV G4F_LOGIN_URL http://localhost:7900/?autoconnect=1&resize=scale&password=secret
10
+
11
+
12
+ # RUN useradd -m -u 1000 user
13
+ USER root
14
+ # ENV PATH="/home/user/.local/bin:$PATH"
15
+ # # ^ when run as `user`, pip installs executables there
16
+
17
+ RUN if [ "$G4F_VERSION" = "" ] ; then \
18
+ apt-get -qqy update && \
19
+ apt-get -qqy install git \
20
+ ; fi
21
+
22
+ RUN apt-get -qqy update \
23
+ && apt-get -qqy upgrade \
24
+ && apt-get -qyy autoremove \
25
+ && apt-get -qqy install python3 python-is-python3 pip \
26
+ && apt-get -qyy remove openjdk-11-jre-headless \
27
+ && apt-get -qyy autoremove \
28
+ && apt-get -qyy clean \
29
+ && rm -rf /var/lib/apt/lists/* /var/cache/apt/*
30
+
31
+ # RUN chown "${SEL_UID}:${SEL_GID}" $HOME/.local
32
 
33
  WORKDIR /app
34
 
35
+ RUN pip install --break-system-packages --upgrade pip \
36
+ && pip install --break-system-packages -r requirements.txt
37
+ # COPY --chown=user ./requirements.txt requirements.txt
38
+ # RUN pip install --no-cache-dir --upgrade -r requirements.txt
39
+
40
+ # ADD --chown=$SEL_UID:$SEL_GID g4f $G4F_DIR/g4f
41
 
42
+ # COPY --chown=user . /app
43
 
44
  CMD ["python", "-m", "g4f" ,"--port" ,"7860", "--debug"]