2026-02-05 10:03:30 +08:00
|
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
# Install uv.
|
|
|
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
|
|
|
|
|
|
|
|
# Copy the application into the container.
|
|
|
|
|
COPY . /app
|
|
|
|
|
|
|
|
|
|
# Install the application dependencies.
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# 更新索引并安装替代包
|
2026-02-05 10:04:29 +08:00
|
|
|
RUN apt-get update && apt-get install -y vim
|
2026-02-05 10:03:30 +08:00
|
|
|
|
|
|
|
|
RUN uv sync --frozen --no-cache
|
|
|
|
|
|
|
|
|
|
# Run the application.
|
|
|
|
|
CMD ["/app/.venv/bin/fastapi", "run", "app/main.py", "--port", "80", "--host", "0.0.0.0"]
|