fix sharp binary installation in frontend image

This commit is contained in:
Ruslan Bakiev
2026-02-20 14:49:28 +07:00
parent c9dd8cbfe2
commit d22c478c38

View File

@@ -8,6 +8,15 @@ RUN apt-get update -y \
COPY package*.json ./
RUN npm ci --ignore-scripts --legacy-peer-deps
RUN set -eux; \
arch="$(dpkg --print-architecture)"; \
if [ "$arch" = "amd64" ]; then \
npm rebuild sharp --platform=linux --arch=x64 || npm install --no-save sharp --platform=linux --arch=x64; \
elif [ "$arch" = "arm64" ]; then \
npm rebuild sharp --platform=linux --arch=arm64 || npm install --no-save sharp --platform=linux --arch=arm64; \
else \
npm rebuild sharp || true; \
fi
COPY . .