Sfoglia il codice sorgente

修改 dockerfile, 创建 python 环境

罗俊辉 1 anno fa
parent
commit
1ab6493305
1 ha cambiato i file con 3 aggiunte e 6 eliminazioni
  1. 3 6
      Dockerfile

+ 3 - 6
Dockerfile

@@ -1,16 +1,13 @@
 # 使用官方Python镜像作为基础镜像
 FROM python:3.10
 
-# 设置工作目录
 WORKDIR /app
 
 # 复制依赖文件到容器中
 COPY requirements.txt /app/
 
-RUN pip install --no-cache-dir -r requirements.txt
+RUN pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
+RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
 
-# 复制你的项目文件到工作目录
-COPY . /app
 
-# 启动服务
-CMD ["hypercorn", "async_app:app", "--config", "hypercorn_config.toml"]
+CMD ["python3"]