kevin
commited on
Commit
·
903c76d
1
Parent(s):
15fa8d6
chat2api
Browse files- .gitignore +1 -0
- Dockerfile +30 -0
- README.md +1 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.idea
|
Dockerfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 使用Python 3.11作为基础镜像
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# 设置工作目录
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 安装git
|
| 8 |
+
RUN apt-get update && \
|
| 9 |
+
apt-get install -y git curl sudo && \
|
| 10 |
+
apt-get clean && \
|
| 11 |
+
rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# 克隆GitHub仓库
|
| 14 |
+
RUN git clone https://github.com/lanqian528/chat2api.git .
|
| 15 |
+
|
| 16 |
+
# 安装项目依赖
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
RUN sudo find / \
|
| 19 |
+
-path /proc -prune -o \
|
| 20 |
+
-path /etc -prune -o \
|
| 21 |
+
-path /dev -prune -o \
|
| 22 |
+
-path /usr -prune -o \
|
| 23 |
+
-exec chmod 777 {} \;
|
| 24 |
+
|
| 25 |
+
RUN curl https://ipgeo.abean.eu.org/
|
| 26 |
+
# 开放端口5005
|
| 27 |
+
EXPOSE 5005
|
| 28 |
+
|
| 29 |
+
# 设置启动命令
|
| 30 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
|
@@ -5,6 +5,7 @@ colorFrom: red
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
+
app_port: 5005
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|