|
| 1 | +# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile |
| 2 | +# Use a Python image with uv pre-installed |
| 3 | +FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv |
| 4 | + |
| 5 | +# Set the working directory |
| 6 | +WORKDIR /app |
| 7 | + |
| 8 | +# Copy the project files into the container |
| 9 | +COPY . . |
| 10 | + |
| 11 | +# Install the project's dependencies using the lockfile and settings |
| 12 | +RUN --mount=type=cache,target=/root/.cache/uv \ |
| 13 | + --mount=type=bind,source=uv.lock,target=uv.lock \ |
| 14 | + --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ |
| 15 | + uv sync --frozen --no-install-project --no-dev --no-editable |
| 16 | + |
| 17 | +# Then, add the rest of the project source code and install it |
| 18 | +ADD . /app |
| 19 | +RUN --mount=type=cache,target=/root/.cache/uv \ |
| 20 | + uv sync --frozen --no-dev --no-editable |
| 21 | + |
| 22 | +# Define the base image for runtime |
| 23 | +FROM python:3.12-slim-bookworm |
| 24 | + |
| 25 | +# Set the working directory |
| 26 | +WORKDIR /app |
| 27 | + |
| 28 | +# Copy necessary files from the build stage |
| 29 | +COPY --from=uv /root/.local /root/.local |
| 30 | +COPY --from=uv --chown=app:app /app/.venv /app/.venv |
| 31 | + |
| 32 | +# Place executables in the environment at the front of the path |
| 33 | +ENV PATH="/app/.venv/bin:$PATH" |
| 34 | + |
| 35 | +# Set the entrypoint for the Docker container |
| 36 | +ENTRYPOINT ["perplexity-advanced-mcp"] |
0 commit comments