leonsimon23 commited on
Commit
158caa1
·
verified ·
1 Parent(s): 2923e05

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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
- # Install git
6
  RUN apt-get update && apt-get install -y git
7
 
8
- # Use build argument for GitHub token
9
  ARG GITHUB_TOKEN
 
10
 
11
- # Clone repository using GitHub token
12
  RUN git clone https://${GITHUB_TOKEN}@github.com/leoncool23/sci_xg_classify.git .
13
 
14
- # Install dependencies
15
  RUN pip install -r requirements.txt
16
 
17
- # Expose the port your app runs on
18
  EXPOSE 8080
19
 
20
- # Command to run your app
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"]