c2a_rexe / Dockerfile
rexcloaa's picture
Update Dockerfile
51000fb verified
raw
history blame contribute delete
583 Bytes
FROM python:3.11
# 更新包列表并安装git和curl
RUN apt update && apt install -y git curl
# 克隆代码仓库
RUN git clone https://github.com/lanqian528/chat2api.git /app
# 设置工作目录
WORKDIR /app
# 创建数据目录并设置权限
RUN mkdir -p /app/data
RUN chmod -R 777 /app/data
# 安装Python依赖包
RUN pip install --no-cache-dir -r requirements.txt
# 暴露端口5005
EXPOSE 5005
# 启动服务器并保持活跃
CMD ["sh", "-c", "python app.py --host 0.0.0.0 --port 5005 & while true; do curl -s http://localhost:5005 > /dev/null; sleep 1800; done"]