Build webui assets in multi-stage Docker image

Add a Node-based webui builder stage that installs frontend dependencies and runs the Vite production build, then copies the generated static/dist assets into the final runtime image.

Move Python dependency installation into a separate venv build stage so compiler and development packages stay out of the runtime image. Also ignore local webui node_modules, Vite cache, and dist output from the Docker build context.
pull/388/head
Antti Kettunen 1 month ago
parent d65ecbe464
commit ed8ff46c9c
No known key found for this signature in database
GPG Key ID: C6B2A3D250359BD7

@ -25,6 +25,11 @@ __pycache__/
dist/
build/
# Frontend build artifacts and local dependency caches
webui/node_modules/
webui/.vite/
webui/static/dist/
# Virtual environments
venv/
env/

@ -1,6 +1,16 @@
# SoulSync WebUI Dockerfile
# Multi-architecture support for AMD64 and ARM64
FROM node:24-slim AS webui-builder
WORKDIR /app/webui
COPY webui/package.json webui/package-lock.json ./
RUN npm ci
COPY webui/ ./
RUN npm run build
# Stage 1: Builder — install Python dependencies with compilation tools
FROM python:3.11-slim AS builder
@ -54,6 +64,7 @@ RUN useradd --create-home --shell /bin/bash --uid 1000 soulsync
# in tools/), it gets counted twice in the image. Cin caught this on
# 2026-05-08 — see the .dockerignore comment for the same incident.
COPY --chown=soulsync:soulsync . .
COPY --chown=soulsync:soulsync --from=webui-builder /app/webui/static/dist /app/webui/static/dist
# Create runtime mount-point directories the app expects to exist.
# NOTE: /app/data is for database FILES, /app/database is the Python package

Loading…
Cancel
Save