-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 1.03 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
FROM python:3.12-slim
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Set working directory
WORKDIR /app
# Runtime libs for fastembed/onnxruntime on Debian slim
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 \
libstdc++6 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY main.py .
COPY pyproject.toml uv.lock README.md ./
COPY src/ ./src/
# Install dependencies with uv
RUN uv sync --frozen
# Initialize ontology graph + vector store during build
RUN --mount=type=secret,id=OPENAI_API_KEY \
OPENAI_API_KEY="$(cat /run/secrets/OPENAI_API_KEY)" \
uv run mathmoddb init
COPY assets/ ./assets/
# Run a dry-run to ensure embedding models are loaded
RUN --mount=type=secret,id=OPENAI_API_KEY \
OPENAI_API_KEY="$(cat /run/secrets/OPENAI_API_KEY)" \
uv run python main.py --dry-run
# Set the entry point
CMD ["uv", "run", "fastmcp", "run", "main.py", \
"--host", "0.0.0.0", \
"--port", "8000", \
"--transport", "streamable-http"]