-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathquantflow.dockerfile
More file actions
51 lines (39 loc) · 1.32 KB
/
Copy pathquantflow.dockerfile
File metadata and controls
51 lines (39 loc) · 1.32 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
# Multi-stage build for quantflow app
# Stage 1: Build stage
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim AS builder
WORKDIR /build
# Install Node.js for Observable Framework frontend build
RUN apt-get update && apt-get install -y --no-install-recommends \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
# Copy dependency files
COPY pyproject.toml uv.lock readme.md ./
# Install dependencies (no root package, with needed extras)
RUN uv sync --frozen --no-install-project --group docs --extra data
# Copy source and build docs
# Example outputs and images must be prebuilt in the build context
# (run `uv run ./dev/build-examples` locally, or the build-examples CI job)
COPY mkdocs.yml ./
COPY dev/ ./dev/
COPY docs/ ./docs/
COPY quantflow/ ./quantflow/
COPY frontend/ ./frontend/
COPY app/ ./app/
RUN npm --prefix frontend install
RUN npm --prefix frontend run build
RUN uv run mkdocs build
# Stage 2: Runtime stage
FROM ghcr.io/astral-sh/uv:python3.14-bookworm-slim
WORKDIR /app
# Copy virtualenv from builder
COPY --from=builder /build/.venv /app/.venv
# Copy application code (app/ from builder includes built docs)
COPY quantflow/ ./quantflow/
COPY --from=builder /build/app ./app
COPY pyproject.toml ./
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8001
CMD ["python", "-m", "app"]