diff --git a/dockerfile b/dockerfile index 390c4f5f..10e4ac7c 100644 --- a/dockerfile +++ b/dockerfile @@ -1,11 +1,12 @@ FROM node:14-alpine3.14 +WORKDIR /app -# sqlite have to build on arm -# TODO: use prebuilt sqlite for arm, because it is very very slow. -RUN apk add --no-cache make g++ python3 +RUN apk add --no-cache make g++ python3 py3-pip python3-dev RUN ln -s /usr/bin/python3 /usr/bin/python -WORKDIR /app +# split the sqlite install here, so that it can caches the arm prebuilt +RUN npm install sqlite3@5.0.2 + COPY . . RUN npm install RUN npm run build diff --git a/package.json b/package.json index 478e3d41..46ff2b34 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "vite build", "vite-preview-dist": "vite preview --host", "build-docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.0.3 . --push", - "build-docker-nightly": "docker buildx build --platform linux/amd64 -t louislam/uptime-kuma:nightly . --push", + "build-docker-nightly": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:nightly . --push", "setup": "git checkout 1.0.3 && npm install && npm run build", "version-global-replace": "node extra/version-global-replace.js" },