Skip to content

Commit 56b1371

Browse files
AlexMikhalevclaude
andauthored
fix(docker): use pre-built frontend assets instead of rebuilding in container (#558)
The frontend-builder stage failed on Alpine because svelma could not resolve bulma Sass imports. The CI pipeline already pre-builds the frontend on ubuntu-22.04 and passes it as an artifact in the Docker build context at desktop/dist/. Replace the Node.js Alpine build stage with a scratch stage that copies pre-built assets directly. This also prepares for the desktop being moved to a separate repository, where in-container frontend builds would no longer be possible. Fixes Docker 20.04 build failure in release workflow. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e28c852 commit 56b1371

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

.github/workflows/docker-multiarch.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ jobs:
209209
build-args: |
210210
UBUNTU_VERSION=${{ matrix.ubuntu-version }}
211211
RUST_VERSION=1.92.0
212-
NODE_VERSION=20
213212
cache-from: type=gha
214213
cache-to: type=gha,mode=max
215214
provenance: false
@@ -229,7 +228,6 @@ jobs:
229228
build-args: |
230229
UBUNTU_VERSION=${{ matrix.ubuntu-version }}
231230
RUST_VERSION=1.92.0
232-
NODE_VERSION=20
233231
cache-from: type=gha
234232
provenance: false
235233
sbom: false

docker/Dockerfile.multiarch

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,16 @@
33

44
ARG UBUNTU_VERSION=22.04
55
ARG RUST_VERSION=1.85.0
6-
ARG NODE_VERSION=20
76

87
# ================================
9-
# Frontend Build Stage
8+
# Frontend Assets Stage
109
# ================================
11-
FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-alpine AS frontend-builder
12-
13-
WORKDIR /app
14-
# Copy package files - yarn.lock is optional
15-
COPY desktop/package*.json ./
16-
COPY desktop/yarn.lock* ./
17-
RUN yarn install --frozen-lockfile --network-timeout 300000
18-
19-
COPY desktop ./
20-
RUN yarn run build
21-
22-
# Verify frontend build
23-
RUN ls -la dist/ && test -f dist/index.html
10+
# Desktop has been moved to a separate repository.
11+
# The CI pipeline (docker-multiarch.yml) pre-builds the frontend
12+
# and places the dist/ output in the Docker build context at desktop/dist/.
13+
# We simply copy those pre-built assets here.
14+
FROM scratch AS frontend-assets
15+
COPY desktop/dist/ /dist/
2416

2517
# ================================
2618
# Rust Build Stage
@@ -124,7 +116,7 @@ RUN . /root/.profile && \
124116
# Copy source code
125117
COPY crates ./crates
126118
COPY terraphim_server ./terraphim_server
127-
COPY --from=frontend-builder /app/dist ./terraphim_server/dist
119+
COPY --from=frontend-assets /dist ./terraphim_server/dist
128120

129121
# Build the application
130122
RUN . /root/.profile && \

0 commit comments

Comments
 (0)