mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Add live update
This commit is contained in:
parent
45de023963
commit
c307d3ee90
2 changed files with 8 additions and 5 deletions
|
|
@ -1,16 +1,18 @@
|
||||||
FROM python:slim-bookworm
|
FROM python:slim-bookworm
|
||||||
|
|
||||||
ARG G4F_VERSION
|
ARG G4F_VERSION
|
||||||
|
ARG G4F_LIVE=true
|
||||||
ARG G4F_USER=g4f
|
ARG G4F_USER=g4f
|
||||||
ARG G4F_USER_ID=1000
|
ARG G4F_USER_ID=1000
|
||||||
|
|
||||||
ENV G4F_VERSION $G4F_VERSION
|
ENV G4F_VERSION $G4F_VERSION
|
||||||
|
ENV G4F_LIVE $G4F_LIVE
|
||||||
ENV G4F_USER $G4F_USER
|
ENV G4F_USER $G4F_USER
|
||||||
ENV G4F_USER_ID $G4F_USER_ID
|
ENV G4F_USER_ID $G4F_USER_ID
|
||||||
ENV G4F_DIR /app
|
ENV G4F_DIR /app
|
||||||
|
|
||||||
RUN apt-get update && apt-get upgrade -y \
|
RUN apt-get update && apt-get upgrade -y \
|
||||||
&& apt-get install -y git \
|
&& apt-get install -y git cron \
|
||||||
# Add user and user group
|
# Add user and user group
|
||||||
&& groupadd -g $G4F_USER_ID $G4F_USER \
|
&& groupadd -g $G4F_USER_ID $G4F_USER \
|
||||||
&& useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
|
&& useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
|
||||||
|
|
@ -25,12 +27,12 @@ WORKDIR $G4F_DIR
|
||||||
ENV HOME /home/$G4F_USER
|
ENV HOME /home/$G4F_USER
|
||||||
ENV PATH "${HOME}/.local/bin:${PATH}"
|
ENV PATH "${HOME}/.local/bin:${PATH}"
|
||||||
|
|
||||||
|
RUN crontab docker/update-cron
|
||||||
|
|
||||||
# Create app dir and copy the project's requirements file into it
|
# Create app dir and copy the project's requirements file into it
|
||||||
RUN mkdir -p $G4F_DIR
|
RUN git clone git@github.com:xtekky/gpt4free.git $G4F_DIR
|
||||||
COPY requirements-slim.txt $G4F_DIR
|
|
||||||
|
|
||||||
# Upgrade pip for the latest features and install the project's Python dependencies.
|
# Upgrade pip for the latest features and install the project's Python dependencies.
|
||||||
RUN pip install --no-cache-dir -r requirements-slim.txt
|
RUN pip install --no-cache-dir -r requirements-slim.txt
|
||||||
|
|
||||||
# Copy the entire package into the container.
|
CMD python -m g4f --debug --reload
|
||||||
ADD --chown=$G4F_USER:$G4F_USER g4f $G4F_DIR/g4f
|
|
||||||
1
docker/update-cron
Normal file
1
docker/update-cron
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
0 * * * * cd /app && python -m etc.update
|
||||||
Loading…
Add table
Add a link
Reference in a new issue