Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +34 -24
Dockerfile
CHANGED
@@ -1,43 +1,53 @@
|
|
1 |
FROM selenium/node-chrome
|
2 |
|
3 |
-
|
4 |
ARG G4F_VERSION
|
5 |
ENV G4F_VERSION $G4F_VERSION
|
|
|
6 |
ENV SE_SCREEN_WIDTH 1850
|
7 |
ENV G4F_DIR /app
|
8 |
ENV G4F_LOGIN_URL http://localhost:7900/?autoconnect=1&resize=scale&password=secret
|
9 |
|
10 |
-
# Create a non-root user
|
11 |
-
RUN useradd -m -u 1000 user
|
12 |
|
13 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
RUN apt-get -qqy update \
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
RUN chown
|
27 |
RUN chmod -R 777 /app
|
28 |
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
# Install Python dependencies
|
33 |
COPY requirements.txt /app
|
|
|
|
|
34 |
RUN pip install --break-system-packages -r requirements.txt
|
35 |
|
36 |
-
# Copy the project files with permissions
|
37 |
-
COPY --chown=user:user . /app
|
38 |
|
39 |
-
#
|
40 |
-
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
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 |
+
|
32 |
|
33 |
+
|
34 |
+
# RUN chown "${SEL_UID}:${SEL_GID}" $HOME/.local
|
35 |
RUN chmod -R 777 /app
|
36 |
|
37 |
+
WORKDIR /app
|
38 |
+
|
39 |
|
|
|
40 |
COPY requirements.txt /app
|
41 |
+
|
42 |
+
|
43 |
RUN pip install --break-system-packages -r requirements.txt
|
44 |
|
|
|
|
|
45 |
|
46 |
+
# COPY --chown=user ./requirements.txt requirements.txt
|
47 |
+
# RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
48 |
+
|
49 |
+
# ADD --chown=$SEL_UID:$SEL_GID g4f $G4F_DIR/g4f
|
50 |
+
|
51 |
+
# COPY --chown=user . /app
|
52 |
|
53 |
+
CMD ["python", "-m", "g4f" ,"--port" ,"7860", "--debug"]
|
|