fix: build print and sign services for arm64 (#6321)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-08-12 19:52:30 +07:00 committed by GitHub
parent 27717058cc
commit 9b65d23fe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 11 deletions

View File

@ -4,16 +4,15 @@ FROM node:20
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
# Set executable path for puppeteer
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y dumb-init && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Install Chromium and fonts
# https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md?plain=1#L397
RUN apt-get update && \
apt-get install -y gnupg wget dumb-init && \
apt-get install -y fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 && \
apt-get install -y chromium --no-install-recommends && \
apt-get clean
WORKDIR /usr/src/app

View File

@ -18,7 +18,9 @@
"_phase:docker-build": "rushx docker:build",
"_phase:docker-staging": "rushx docker:staging",
"bundle": "mkdir -p bundle && esbuild src/index.ts --bundle --platform=node --keep-names > bundle/bundle.js",
"docker:build": "cross-env DOCKER_EXTRA=--platform=linux/amd64 ../../../common/scripts/docker_build.sh hardcoreeng/print",
"docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/print",
"docker:tbuild": "docker build -t hardcoreeng/print . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/print",
"docker:abuild": "docker build -t hardcoreeng/print . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/print",
"docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/print staging",
"docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/print",
"run-local": "cross-env ts-node src/index.ts",

View File

@ -18,8 +18,9 @@
"_phase:docker-build": "rushx docker:build",
"_phase:docker-staging": "rushx docker:staging",
"bundle": "mkdir -p bundle && esbuild src/index.ts --bundle --platform=node --keep-names > bundle/bundle.js",
"docker:build": "cross-env DOCKER_EXTRA=--platform=linux/amd64 ../../../common/scripts/docker_build.sh hardcoreeng/sign",
"docker:build": "../../../common/scripts/docker_build.sh hardcoreeng/sign",
"docker:tbuild": "docker build -t hardcoreeng/sign . --platform=linux/amd64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/sign",
"docker:abuild": "docker build -t hardcoreeng/sign . --platform=linux/arm64 && ../../../common/scripts/docker_tag_push.sh hardcoreeng/sign",
"docker:staging": "../../../common/scripts/docker_tag.sh hardcoreeng/sign staging",
"docker:push": "../../../common/scripts/docker_tag.sh hardcoreeng/sign",
"run-local": "cross-env ts-node src/index.ts",