🔧 chore(config): 移动配置文件到Python目录
- 将.pre-commit-config.yaml移动到Python目录以便于管理 - 其他相关文件也进行了相应的重命名和移动
This commit is contained in:
30
Python/Web/Dockerfile
Normal file
30
Python/Web/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM python:3.12-slim-bookworm
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 设置环境变量
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# 安装系统依赖
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制依赖文件
|
||||
COPY pyproject.toml .
|
||||
|
||||
# 安装项目依赖
|
||||
RUN uv pip compile pyproject.toml -o requirements.txt && pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 复制项目文件
|
||||
COPY . .
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8000
|
||||
|
||||
# 启动命令
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000","--workers", "8","--timeout-keep-alive", "30"]
|
||||
Reference in New Issue
Block a user