docker: update Dockerfile to use Docker-specific workspace file and adjust pnpm install options

This commit is contained in:
Carlos Santos 2025-10-22 18:16:07 +02:00
parent 46bbeacc66
commit 8764fda04d
3 changed files with 30 additions and 7 deletions

View File

@ -18,7 +18,9 @@ RUN mkdir -p meet-ce/typings meet-ce/frontend/webcomponent meet-ce/backend && \
USER node
# Copy workspace configuration files
COPY --chown=node:node pnpm-workspace.yaml .npmrc package.json pnpm-lock.yaml ./
# Use Docker-specific workspace file that excludes external packages
COPY --chown=node:node pnpm-workspace.docker.yaml ./pnpm-workspace.yaml
COPY --chown=node:node .npmrc package.json pnpm-lock.yaml ./
# Copy package.json files for all workspace packages
COPY --chown=node:node meet-ce/typings/package.json ./meet-ce/typings/
@ -37,7 +39,7 @@ COPY --chown=node:node meet.sh .
ARG BASE_HREF=/
# Build OpenVidu Meet project
RUN pnpm install --frozen-lockfile && \
RUN pnpm install --no-frozen-lockfile && \
./meet.sh build --skip-install --base-href=${BASE_HREF}
# Clean up development dependencies and unnecessary files
@ -65,7 +67,7 @@ ENV PNPM_VERSION=${PNPM_VERSION}
RUN apk add --no-cache bash
# Install pnpm
RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate && ls -al .
RUN corepack enable && corepack prepare pnpm@${PNPM_VERSION} --activate
WORKDIR /opt/openvidu-meet

12
meet.sh
View File

@ -708,8 +708,9 @@ clone_meet_pro() {
# Build Docker image
build_docker() {
local image_name="$1"
# Remove first argument (image name)
shift || true
local components_next_version
components_next_version=$(pnpm view openvidu-components-angular@next version | tr -d '\r\n')
shift || true # Remove first argument (image name)
# Validate arguments
if [ -z "$image_name" ]; then
@ -754,7 +755,8 @@ build_docker() {
# Optionally install latest components to avoid local dist symlink inside image
if [ "$use_latest_components" = true ]; then
echo "🔧 Installing latest openvidu-components-angular..."
pnpm --filter @openvidu-meet/frontend install openvidu-components-angular@next
sed -i 's|"openvidu-components-angular": "workspace:\*"|"openvidu-components-angular": "^3.0.0"|g' meet-ce/frontend/projects/shared-meet-components/package.json
pnpm --filter @openvidu-meet/frontend install openvidu-components-angular@${components_next_version}
fi
echo -e "${GREEN}Using BASE_HREF: $base_href${NC}"
@ -772,7 +774,9 @@ build_docker() {
# Restore local link if we temporarily installed latest components
if [ "$use_latest_components" = true ]; then
echo "🔧 Restoring openvidu-components-angular to local dist link..."
pnpm --filter @openvidu-meet/frontend install openvidu-components-angular@link:../../../openvidu/openvidu-components-angular/dist/openvidu-components-angular
sed -i 's|"openvidu-components-angular": "^3.0.0"|"openvidu-components-angular": "workspace:*"|g' meet-ce/frontend/projects/shared-meet-components/package.json
sed -i 's|"openvidu-components-angular": "'"${components_next_version}"'"|"openvidu-components-angular": "workspace:*"|g' meet-ce/frontend/package.json
pnpm install --no-frozen-lockfile
fi
}

View File

@ -0,0 +1,17 @@
packages:
- meet-ce/typings
- meet-ce/frontend
- meet-ce/frontend/webcomponent
- meet-ce/frontend/projects/shared-meet-components
- meet-ce/backend
ignoredBuiltDependencies:
- '@parcel/watcher'
- chromedriver
- core-js
- esbuild
- lmdb
- msgpackr-extract
onlyBuiltDependencies:
- bcrypt