kingtest commited on
Commit
24c92bf
·
verified ·
1 Parent(s): 31517f8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -11
Dockerfile CHANGED
@@ -1,17 +1,22 @@
1
- # 使用官方 Python 基础镜像
2
- FROM python:3.8-slim
 
 
 
 
 
 
 
 
3
 
4
  # 设置工作目录
5
  WORKDIR /app
6
 
7
- # 将依赖安装需求复制到容器中
8
- COPY requirements.txt .
9
-
10
- # 安装 Python 依赖
11
- RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # 将当前目录下的所有文件复制到容器中
14
- COPY . .
15
 
16
- # 运行 Uvicorn 服务器
17
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # 指定基础镜像为node的alpine版本
2
+ FROM node:14-alpine
3
+
4
+ # 设置环境变量
5
+ ENV DL_SESSION 40ef9830-ced3-4f4b-b391-35b98479110f
6
+
7
+ # 安装git,克隆仓库,然后移除git以减小镜像体积
8
+ RUN apk add --no-cache git && \
9
+ git clone https://github.com/xiaozhou26/deeplx-pro.git /app && \
10
+ apk del git
11
 
12
  # 设置工作目录
13
  WORKDIR /app
14
 
15
+ # 安装app依赖包
16
+ RUN npm install --production
 
 
 
17
 
18
+ # 暴露容器端口
19
+ EXPOSE 9000
20
 
21
+ # 定义容器启动时执行的命令
22
+ CMD ["node", "index.js"]