diff --git a/Dockerfile b/Dockerfile index 56b394d..cfba6b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN apk upgrade --no-cache -a && \ npm_config_target_platform=linux npm_config_target_arch=x64 npm run build && \ rm -r /app/client/.angular /app/client/node_modules /app/node_modules && \ npm_config_target_platform=linux npm_config_target_arch=x64 yarn install --pure-lockfile --production && \ - for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "x86-64" | sed "s|\(.*\):.*|\1|g"); do rm -v "$file"; done; \ + for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "x86-64\|x86_64" | sed "s|[^:]:.*|\1|g"); do rm -v "$file"; done; \ elif [ "$TARGETARCH" = "arm64" ]; then \ cd /app/client && \ npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --pure-lockfile && \ @@ -27,7 +27,7 @@ RUN apk upgrade --no-cache -a && \ npm_config_target_platform=linux npm_config_target_arch=arm64 npm run build && \ rm -r /app/client/.angular /app/client/node_modules /app/node_modules && \ npm_config_target_platform=linux npm_config_target_arch=arm64 yarn install --pure-lockfile --production && \ - for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "aarch64" | sed "s|\(.*\):.*|\1|g"); do rm -v "$file"; done; \ + for file in $(find /app/node_modules -name "*.node" -type f -exec file {} \; | grep -v "aarch64\|arm64" | sed "s|[^:]:.*|\1|g"); do rm -v "$file"; done; \ fi && \ yarn cache clean --all && \ clean-modules --yes @@ -35,8 +35,8 @@ FROM alpine:3.20.1 AS strip COPY --from=build /app /app RUN apk upgrade --no-cache -a && \ apk add --no-cache ca-certificates binutils file && \ - find /app/node_modules -name "*.node" -exec strip -s {} \; && \ - find /app/node_modules -name "*.node" -exec file {} \; + find /app/node_modules -name "*.node" -type f -exec strip -s {} \; && \ + find /app/node_modules -name "*.node" -type f -exec file {} \; FROM alpine:3.20.1 COPY --chown=1000:1000 --from=strip /app /app