Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -6
Dockerfile
CHANGED
|
@@ -1,21 +1,24 @@
|
|
| 1 |
# syntax=docker/dockerfile:1.4
|
| 2 |
FROM python:3.9-slim
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
RUN apt-get update && apt-get install -y git
|
| 7 |
|
| 8 |
-
#
|
| 9 |
ARG GITHUB_TOKEN
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
RUN git clone https://${GITHUB_TOKEN}@github.com/leoncool23/sci_xg_classify.git .
|
| 13 |
|
| 14 |
-
#
|
| 15 |
RUN pip install -r requirements.txt
|
| 16 |
|
| 17 |
-
#
|
| 18 |
EXPOSE 8080
|
| 19 |
|
| 20 |
-
#
|
| 21 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
# syntax=docker/dockerfile:1.4
|
| 2 |
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# 设置工作目录
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# 安装必要的依赖
|
| 8 |
RUN apt-get update && apt-get install -y git
|
| 9 |
|
| 10 |
+
# 使用环境变量传递 GitHub Token
|
| 11 |
ARG GITHUB_TOKEN
|
| 12 |
+
ENV GITHUB_TOKEN=${GITHUB_TOKEN}
|
| 13 |
|
| 14 |
+
# 克隆私有仓库
|
| 15 |
RUN git clone https://${GITHUB_TOKEN}@github.com/leoncool23/sci_xg_classify.git .
|
| 16 |
|
| 17 |
+
# 安装 Python 依赖
|
| 18 |
RUN pip install -r requirements.txt
|
| 19 |
|
| 20 |
+
# 暴露应用运行的端口
|
| 21 |
EXPOSE 8080
|
| 22 |
|
| 23 |
+
# 启动应用
|
| 24 |
CMD ["python", "app.py"]
|