g4faaaa / Dockerfile
zhzabcd's picture
Update Dockerfile
7076677 verified
Raw
History Blame Contribute Delete
777 Bytes
# 使用一个包含 Python 的基础镜像
FROM python:3.9
# 安装必要的系统依赖
RUN apt-get update && \
apt-get install -y \
python3-gi \
gir1.2-gtk-3.0 \
libgirepository1.0-dev \
libgtk-3-dev \
libqt5core5a \
libqt5gui5 \
libqt5widgets5 \
qtbase5-dev \
libwebkit2gtk-4.0-dev \
python3-pip \
python3-setuptools \
python3-wheel \
&& apt-get clean
# 安装 PyGObject 和 PyQt5
RUN pip install -U pygobject PyQt5 qtpy
# 安装 pywebview 和其他必要的 Python 包
RUN pip install -U pywebview g4f[all]
# 设置工作目录
WORKDIR /app
# 拷贝应用代码到容器中
COPY . /app
# 暴露端口
EXPOSE 7860
# 运行应用
CMD ["python", "-m", "g4f.api.run", "-debug", "-host", "0.0.0.0", "-port", "7860"]