XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Add live update

c307d3ee
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +8 -5
Modified docker/Dockerfile-slim +7 -5
@@ -1,16 +1,18 @@
1 1 FROM python:slim-bookworm
2 2
3 3 ARG G4F_VERSION
4 ARG G4F_LIVE=true
4 5 ARG G4F_USER=g4f
5 6 ARG G4F_USER_ID=1000
6 7
7 8 ENV G4F_VERSION $G4F_VERSION
9 ENV G4F_LIVE $G4F_LIVE
8 10 ENV G4F_USER $G4F_USER
9 11 ENV G4F_USER_ID $G4F_USER_ID
10 12 ENV G4F_DIR /app
11 13
12 14 RUN apt-get update && apt-get upgrade -y \
13 && apt-get install -y git \
15 && apt-get install -y git cron \
14 16 # Add user and user group
15 17 && groupadd -g $G4F_USER_ID $G4F_USER \
16 18 && useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
@@ -25,12 +27,12 @@ WORKDIR $G4F_DIR
25 27 ENV HOME /home/$G4F_USER
26 28 ENV PATH "${HOME}/.local/bin:${PATH}"
27 29
30 RUN crontab docker/update-cron
31
28 32 # Create app dir and copy the project's requirements file into it
29 RUN mkdir -p $G4F_DIR
30 COPY requirements-slim.txt $G4F_DIR
33 RUN git clone git@github.com:xtekky/gpt4free.git $G4F_DIR
31 34
32 35 # Upgrade pip for the latest features and install the project's Python dependencies.
33 36 RUN pip install --no-cache-dir -r requirements-slim.txt
34 37
35 # Copy the entire package into the container.
36 ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f
38 CMD python -m g4f --debug --reload
Added docker/update-cron +1 -0
@@ -0,0 +1 @@
1 0 * * * * cd /app && python -m etc.update