add feature bulding

This commit is contained in:
ext-ensky-jeremy.jj.he
2025-08-29 17:30:00 +08:00
parent 9415c1578b
commit 9cf76a8417
8 changed files with 492 additions and 6 deletions

40
dockerfile Normal file
View File

@@ -0,0 +1,40 @@
FROM python:3.10
ENV PYTHONUNBUFFERED=1
WORKDIR /app/
# Install uv
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
COPY --from=ghcr.io/astral-sh/uv:0.5.11 /uv /uvx /bin/
# # Place executables in the environment at the front of the path
# # Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment
ENV PATH="/app/.venv/bin:$PATH"
# # Compile bytecode
# # Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode
ENV UV_COMPILE_BYTECODE=1
# # uv Cache
# # Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching
ENV UV_LINK_MODE=copy
# Install dependencies
# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project
ENV PYTHONPATH=/app
COPY . .
RUN ls
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync
CMD ["uv","run","src/mcp_server.py"]