dan92 commited on
Commit
8380d74
·
verified ·
1 Parent(s): bd8a4e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -35
Dockerfile CHANGED
@@ -1,35 +1 @@
1
- # 使用 Python 3.11 作为基础镜像
2
- FROM python:3.11-slim
3
-
4
- # 设置为中国国内源(针对 Bookworm/Debian 12)
5
- RUN rm -rf /etc/apt/sources.list.d/* && \
6
- echo "deb http://mirrors.ustc.edu.cn/debian bookworm main" > /etc/apt/sources.list && \
7
- echo "deb http://mirrors.ustc.edu.cn/debian bookworm-updates main" >> /etc/apt/sources.list && \
8
- echo "deb http://mirrors.ustc.edu.cn/debian-security bookworm-security main" >> /etc/apt/sources.list
9
-
10
- # 设置工作目录
11
- WORKDIR /app
12
-
13
- # 设置环境变量
14
- ENV PYTHONUNBUFFERED=1 \
15
- PYTHONDONTWRITEBYTECODE=1 \
16
- POETRY_VERSION=1.6.1
17
-
18
- # 安装系统依赖
19
- RUN apt-get update \
20
- && apt-get install -y --no-install-recommends \
21
- curl \
22
- build-essential \
23
- && rm -rf /var/lib/apt/lists/*
24
-
25
- # 复制项目文件
26
- COPY . .
27
-
28
- # 安装 Python 依赖
29
- RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
30
-
31
- # 暴露端口
32
- EXPOSE 8000
33
-
34
- # 启动命令
35
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ FROM dangbei/api-proxy:latest