mirror of
https://github.com/colanode/colanode.git
synced 2026-09-01 19:50:56 +02:00
* Latest npm in @colanode/web Docker, add optional plat/arch dependencies There are a number of issues with lightningcss and node 22/npm. This is related to platform-/architecture-specific packages. This uses a number of pieces from multiple solutions found in the notes for #160. This addresses the issues by the following measures: - Make sure npm is up-to-date in the @colanode/web Docker build - Add optional dependencies for all the platform-specific lightningcss packages that are most likely to be used in the project (HSF and mainline) in the npm project modules that require them: - @colanode/desktop - @colanode/web - @colanode/ui Closes #159. * Fix darwin-arm64 version. * Remove unnecessary optional dependencies; remove duplicate version property * Fix merge issue where the version field got deleted. * Move the version field back to where it was before.
48 lines
1.2 KiB
Docker
48 lines
1.2 KiB
Docker
FROM node:22-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy root workspace files
|
|
COPY package.json package-lock.json ./
|
|
|
|
# Copy scripts
|
|
COPY ../../scripts scripts
|
|
|
|
# Copy assets
|
|
COPY ../../assets assets
|
|
|
|
# Copy all package.json files first
|
|
COPY ../../packages/core/package.json packages/core/package.json
|
|
COPY ../../packages/crdt/package.json packages/crdt/package.json
|
|
COPY ../../packages/client/package.json packages/client/package.json
|
|
COPY ../../packages/ui/package.json packages/ui/package.json
|
|
COPY ../../apps/web/package.json apps/web/package.json
|
|
|
|
# Install dependencies
|
|
RUN npm i -g npm@latest && npm ci
|
|
|
|
# Copy source files
|
|
COPY ../../packages/core packages/core
|
|
COPY ../../packages/crdt packages/crdt
|
|
COPY ../../packages/client packages/client
|
|
COPY ../../packages/ui packages/ui
|
|
COPY ../../apps/web apps/web
|
|
COPY ../../tsconfig.base.json ./
|
|
|
|
# Build packages
|
|
RUN npm run build -w @colanode/core && \
|
|
npm run build -w @colanode/crdt && \
|
|
npm run build -w @colanode/client && \
|
|
npm run build -w @colanode/ui && \
|
|
npm run build -w @colanode/web && \
|
|
npm prune --production
|
|
|
|
|
|
FROM nginx:1.27-alpine
|
|
|
|
COPY --from=build /app/apps/web/dist /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|