-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 905 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 905 Bytes
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
# Stage 1: Builder
FROM python:3.11-slim AS builder
WORKDIR /app
# Install build dependencies for pyswisseph (C extension)
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
g++ \
make \
&& rm -rf /var/lib/apt/lists/*
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Copy dependency files and source (needed for hatchling to build)
COPY pyproject.toml uv.lock README.md ./
COPY src/ src/
# Install dependencies with frozen lockfile (reproducible)
RUN uv sync --frozen --no-dev --no-editable
# Stage 2: Runtime
FROM python:3.11-slim
WORKDIR /app
# Copy virtual environment from builder
COPY --from=builder /app/.venv /app/.venv
# Copy source code
COPY --from=builder /app/src /app/src
# Use the virtual environment
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app/src"
# Run the MCP server
CMD ["python", "-m", "ephemeris_mcp.server"]