2026-05-05 17:27:44 +00:00
|
|
|
ARG ELEMENT_VERSION=latest@sha256:f4a81a24d49a9c5b97e02e77a3013ec799873e500e69041078a28be98e4f1280
|
2025-02-17 09:49:12 +00:00
|
|
|
|
2026-04-21 19:39:27 +00:00
|
|
|
FROM --platform=$BUILDPLATFORM node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f AS builder
|
2025-02-17 09:49:12 +00:00
|
|
|
|
2025-02-25 15:29:56 +00:00
|
|
|
ARG BUILD_CONTEXT
|
2025-02-17 09:49:12 +00:00
|
|
|
|
2025-02-25 15:29:56 +00:00
|
|
|
RUN apk add --no-cache jq
|
2025-02-17 09:49:12 +00:00
|
|
|
|
2025-02-25 15:29:56 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package.json yarn.lock ./
|
2025-03-13 16:39:06 +00:00
|
|
|
# Copy the package.json files of all modules & packages to ensure the frozen workspace lockfile holds up
|
|
|
|
|
RUN --mount=type=bind,target=/docker-context \
|
|
|
|
|
cd /docker-context/; \
|
|
|
|
|
find . -path ./node_modules -prune -o -name "package.json" -mindepth 0 -maxdepth 4 -exec cp --parents "{}" /app/ \;
|
2025-02-25 15:29:56 +00:00
|
|
|
RUN yarn install --frozen-lockfile --ignore-scripts
|
|
|
|
|
COPY tsconfig.json ./
|
|
|
|
|
COPY ./$BUILD_CONTEXT ./$BUILD_CONTEXT
|
|
|
|
|
RUN cd $BUILD_CONTEXT && yarn vite build
|
|
|
|
|
RUN mkdir /modules
|
|
|
|
|
RUN cp -r ./$BUILD_CONTEXT/lib/ /modules/$(jq -r '"\(.name)-v\(.version)"' ./$BUILD_CONTEXT/package.json)
|
|
|
|
|
|
|
|
|
|
FROM ghcr.io/element-hq/element-web:${ELEMENT_VERSION}
|
|
|
|
|
|
2025-03-13 14:06:02 +00:00
|
|
|
COPY --from=builder /modules /modules/
|