mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-24 13:07:53 +08:00
42 lines
1.3 KiB
Plaintext
42 lines
1.3 KiB
Plaintext
FROM python:slim-bookworm
|
|
|
|
ARG G4F_VERSION
|
|
ARG G4F_LIVE=true
|
|
ARG G4F_USER=g4f
|
|
ARG G4F_USER_ID=1000
|
|
|
|
ENV G4F_VERSION $G4F_VERSION
|
|
ENV G4F_LIVE $G4F_LIVE
|
|
ENV G4F_USER $G4F_USER
|
|
ENV G4F_USER_ID $G4F_USER_ID
|
|
ENV G4F_DIR /app
|
|
|
|
RUN apt-get update && apt-get upgrade -y \
|
|
&& apt-get install -y git cron ffmpeg flac \
|
|
# Add user and user group
|
|
&& groupadd -g $G4F_USER_ID $G4F_USER \
|
|
&& useradd -rm -G sudo -u $G4F_USER_ID -g $G4F_USER_ID $G4F_USER \
|
|
&& echo "${G4F_USER}:${G4F_USER}" | chpasswd \
|
|
&& python -m pip install --upgrade pip \
|
|
&& apt-get clean \
|
|
&& rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
RUN mkdir -p $G4F_DIR
|
|
RUN chown "${G4F_USER_ID}:${G4F_USER_ID}" $G4F_DIR
|
|
|
|
USER $G4F_USER_ID
|
|
WORKDIR $G4F_DIR
|
|
|
|
ENV HOME /home/$G4F_USER
|
|
ENV PATH "${HOME}/.local/bin:${PATH}"
|
|
|
|
RUN git clone https://github.com/xtekky/gpt4free.git $G4F_DIR \
|
|
&& printf "*/15 * * * * ./docker/start.sh\n" > cronfile \
|
|
&& printf "*/15 * * * * python -m etc.tool.update\n" >> cronfile && crontab cronfile \
|
|
&& pip install --no-cache-dir -r requirements-min.txt
|
|
RUN git clone https://github.com/hlohaus/deepseek4free.git \
|
|
&& cd deepseek4free && git checkout 21Feb \
|
|
&& pip install --no-cache-dir . && cd .. && rm -rf deepseek4free
|
|
|
|
USER root
|
|
CMD cron && su -c docker/start.sh $G4F_USER |