QFix: Install ws in dockerfile

Signed-off-by: Artem Savchenko <armisav@gmail.com>
This commit is contained in:
Artem Savchenko 2025-05-15 16:46:47 +07:00
parent f26df5ce93
commit 77060ee7eb
3 changed files with 13 additions and 3 deletions

View File

@ -48,8 +48,7 @@
"@types/jest": "^29.5.5",
"@types/ws": "^8.5.11",
"@types/node-fetch": "~2.6.2",
"@types/snappyjs": "^0.7.1",
"ws": "^8.18.0"
"@types/snappyjs": "^0.7.1"
},
"dependencies": {
"@hcengineering/account-client": "^0.6.0",
@ -67,5 +66,8 @@
"repository": "https://github.com/hcengineering/platform",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"optionalDependencies": {
"ws": "^8.18.0"
}
}

View File

@ -1,6 +1,14 @@
FROM hardcoreeng/base:v20250310
WORKDIR /usr/src/app
COPY package.json ./
# Install ws as external dependency, since it is not included in the base image
RUN WS_VERSION=$(grep -o '"ws": *"[^"]*"' package.json | grep -o '[0-9][^"]*' | head -1) && \
if [ -z "$WS_VERSION" ]; then WS_VERSION="8.18.0"; fi && \
echo "Installing ws version: $WS_VERSION" && \
rm package.json && \
npm install --no-package-lock ws@$WS_VERSION
COPY bundle/bundle.js ./
EXPOSE 8087

View File

@ -17,7 +17,7 @@
"_phase:bundle": "rushx bundle",
"_phase:docker-build": "rushx docker:build",
"_phase:docker-staging": "rushx docker:staging",
"bundle": "node ../../../common/scripts/esbuild.js",
"bundle": "node ../../../common/scripts/esbuild.js --external=ws",
"docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/gmail",
"docker:tbuild": "docker build -t hardcoreeng/gmail . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/gmail",
"docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/gmail staging",