-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
55 lines (42 loc) · 2.11 KB
/
Dockerfile.dev
File metadata and controls
55 lines (42 loc) · 2.11 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
# Stage 1: build web UI (produces matyan-ui/src/matyan_ui/static/ including index-template.html)
# Pin to host platform so npm build runs natively; static assets are platform-agnostic.
FROM --platform=$BUILDPLATFORM node:20-slim AS web-builder
WORKDIR /app
RUN mkdir -p matyan-ui/src/matyan_ui
# Copy only deps manifest + public (needed for postinstall); npm ci layer caches until deps change
COPY matyan-ui/web/package.json matyan-ui/web/package-lock.json* ./matyan-ui/web/
COPY matyan-ui/web/public/ ./matyan-ui/web/public/
ENV npm_config_cache=/root/.npm
RUN --mount=type=cache,target=/root/.npm \
cd matyan-ui/web && npm ci --legacy-peer-deps
# Copy rest of web (src, config); only this layer invalidates on source changes
COPY matyan-ui/web/ ./matyan-ui/web/
# Node 17+ uses OpenSSL 3.0; react-scripts 4 / webpack 4 need legacy provider for hashing
ENV NODE_OPTIONS=--openssl-legacy-provider
ENV GENERATE_SOURCEMAP=false
RUN cd matyan-ui/web && npm run build
# Stage 2: Python runtime with pre-built static files
FROM debian:bookworm-20260316-slim AS base
ARG IMAGE_VERSION=dev
LABEL org.opencontainers.image.title="matyan-ui"
LABEL org.opencontainers.image.description="Matyan web UI server — serves the React app and static assets"
LABEL org.opencontainers.image.version="${IMAGE_VERSION}"
LABEL org.opencontainers.image.source="https://github.com/4gt-104/matyan-core"
LABEL org.opencontainers.image.documentation="https://4gt-104.github.io/matyan-core/"
LABEL org.opencontainers.image.licenses="Apache-2.0"
ARG PIXI_VERSION=v0.66.0
ENV PATH="/root/.pixi/bin:${PATH}"
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://pixi.sh/install.sh | PIXI_VERSION=${PIXI_VERSION} bash
WORKDIR /app/matyan-ui
COPY matyan-ui/pyproject.toml matyan-ui/pixi.lock ./
RUN pixi install -e dev --frozen --skip matyan-ui
COPY matyan-ui/src/ ./src/
COPY --from=web-builder /app/matyan-ui/src/matyan_ui/static ./src/matyan_ui/static
RUN pixi install -e dev --frozen
ENV PATH="/app/matyan-ui/.pixi/envs/dev/bin:${PATH}"
CMD ["matyan-ui"]