Files
element-web/packages/module-api/Dockerfile
T

24 lines
994 B
Docker
Raw Normal View History

ARG ELEMENT_VERSION=latest@sha256:a84f294ce46e4327ebacecb78bfc94cf6a45c7ffa5104a28f06b5ac69d0b2548
2025-02-17 09:49:12 +00:00
2026-03-31 14:27:28 +00:00
FROM --platform=$BUILDPLATFORM node:lts-alpine@sha256:01743339035a5c3c11a373cd7c83aeab6ed1457b55da6a69e014a95ac4e4700b 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 ./
# 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/