This repository was archived by the owner on Jun 18, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.aws
More file actions
58 lines (44 loc) · 2.28 KB
/
Copy pathDockerfile.aws
File metadata and controls
58 lines (44 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use a Python image with uv pre-installed
# https://github.com/smithery-ai/reference-servers/blob/main/src/git/Dockerfile
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv
# Install the project into `/app`
WORKDIR /app
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy
# Add the project source code
ADD . /app
# Create virtual environment and install the project with its dependencies
RUN --mount=type=cache,target=/root/.cache/uv \
uv venv --python 3.12 && \
. .venv/bin/activate && \
uv pip install -e .
FROM python:3.12-slim-bookworm
# AWS Lambda Web Adapter — bridges Lambda's event model to a plain HTTP server.
# It intercepts Lambda invocations and proxies them as HTTP requests to uvicorn
# on $PORT, so the app needs no Lambda-specific code.
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:1.0.0-rc1 /lambda-adapter /opt/extensions/lambda-adapter
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=uv /app/.venv /app/.venv
COPY --from=uv /app /app
EXPOSE 8080
# Use the system Python from the base image rather than the venv symlink.
# In Lambda, /app/.venv/bin/python is a symlink back to the build-stage Python
# which doesn't exist in the final image; resolving that symlink at exec time
# causes a "no such file" error. /usr/local/bin/python3 is the real binary that
# the python:3.12-slim-bookworm base ships and is always executable.
# We point PYTHONPATH at the venv site-packages so all installed packages are found.
ENV PYTHONPATH="/app/.venv/lib/python3.12/site-packages:/app/src"
# Lambda Web Adapter config: tell it which port uvicorn is on and activate it.
# AWS_LWA_INVOKE_MODE must match the Lambda Function URL invoke_mode = "RESPONSE_STREAM".
ENV PORT=8080
ENV AWS_LAMBDA_EXEC_WRAPPER=/opt/extensions/lambda-adapter
ENV AWS_LWA_INVOKE_MODE=response_stream
# Default: stdio (for local use / Claude Desktop).
# For Lambda / remote HTTP: MCP_TRANSPORT=streamable-http MCP_STATELESS=true via env vars.
# The streamable-http endpoint is mounted at /mcp (FastMCP default).
ENTRYPOINT ["/usr/local/bin/python3", "-m", "mcp_paradex"]
CMD []