# 使用Python的官方镜像 | |
FROM python:3.9-slim | |
# 设置工作目录 | |
WORKDIR /app | |
# 复制本地代码到容器中 | |
COPY . /app | |
# 安装依赖 | |
RUN pip install --no-cache-dir -r requirements.txt | |
# 设置容器启动时的命令 | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |
# 使用Python的官方镜像 | |
FROM python:3.9-slim | |
# 设置工作目录 | |
WORKDIR /app | |
# 复制本地代码到容器中 | |
COPY . /app | |
# 安装依赖 | |
RUN pip install --no-cache-dir -r requirements.txt | |
# 设置容器启动时的命令 | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] |