free-gpt-api / Dockerfile
jjx20241116's picture
Update Dockerfile
f0b1752 verified
raw
history blame contribute delete
677 Bytes
# 选择基础镜像
FROM ubuntu:22.04
# 设置环境变量,避免一些安装过程中的交互
ENV DEBIAN_FRONTEND=noninteractive
USER root
# 更新包管理器并安装必要的软件
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
curl \
wget \
git \
build-essential \
software-properties-common \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
#安装依赖
RUN pip install -U g4f[all]
# 设置工作目录
WORKDIR /app
# 复制当前目录的内容到容器的工作目录
COPY . /app
# 暴露容器端口(可选,根据需求设置)
EXPOSE 1337
# 启动应用
CMD ["python3", "-m", "g4f.api.run"]