feat: 添加云托管部署配置文件

This commit is contained in:
2026-03-05 18:58:33 +08:00
parent d47ccd7039
commit 6416441539
4 changed files with 65 additions and 0 deletions

19
server/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
FROM python:3.11-slim
WORKDIR /app
# 安装依赖
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# 复制代码
COPY . .
# 删除本地环境配置,使用容器环境变量
RUN rm -f .env
# 暴露端口
EXPOSE 3000
# 启动命令
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "3000"]