From 91bcbec2af0c8f736f6fe03913fe3c286b43fed4 Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 18:06:06 +0100 Subject: [PATCH 1/9] + v6 and arm platform --- .github/workflows/cd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 6d8a7f73..824001ef 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -19,12 +19,14 @@ jobs: - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - uses: mr-smithers-excellent/docker-build-push@v5 + - uses: mr-smithers-excellent/docker-build-push@v6 name: Build & push Docker image for ${{ matrix.db-type }} with: image: umami tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest buildArgs: DATABASE_TYPE=${{ matrix.db-type }} registry: ghcr.io + multiPlatform: true + platform: linux/amd64,linux/arm64 username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From 4362be44e07a52e643083109f8748e52a430ce3a Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 18:08:13 +0100 Subject: [PATCH 2/9] updated manual cd action --- .github/workflows/cd-manual.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd-manual.yml b/.github/workflows/cd-manual.yml index 6b04dd84..f62f3e45 100644 --- a/.github/workflows/cd-manual.yml +++ b/.github/workflows/cd-manual.yml @@ -20,12 +20,14 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: mr-smithers-excellent/docker-build-push@v5 + - uses: mr-smithers-excellent/docker-build-push@v6 name: Build & push Docker image for ${{ matrix.db-type }} with: image: umami tags: ${{ matrix.db-type }}-${{ inputs.version }}, ${{ matrix.db-type }}-latest buildArgs: DATABASE_TYPE=${{ matrix.db-type }} registry: ghcr.io + multiPlatform: true + platform: linux/amd64,linux/arm64 username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} From 7df58a921fdf7db42a15482fd949c1b12702404c Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 18:35:36 +0100 Subject: [PATCH 3/9] Added network timeout for yarn --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index eb7ebf1a..e91765a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ FROM node:16-alpine AS deps RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json yarn.lock ./ +RUN yarn config set network-timeout 300000 RUN yarn install --frozen-lockfile # Rebuild the source code only when needed From c07a561eda108c6f33fd2f3d231c41ee301fc086 Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 19:53:49 +0100 Subject: [PATCH 4/9] Made the builder run as amd64 to avoid prisma arm problems --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e91765a6..545d54cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,15 @@ # Install dependencies only when needed -FROM node:16-alpine AS deps +FROM node:18-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app COPY package.json yarn.lock ./ +# Add yarn timeout to handle slow CPU when Github Actions RUN yarn config set network-timeout 300000 RUN yarn install --frozen-lockfile # Rebuild the source code only when needed -FROM node:16-alpine AS builder +FROM --platform=linux/amd64 node:18-alpine AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . @@ -24,7 +25,7 @@ ENV NEXT_TELEMETRY_DISABLED 1 RUN yarn build-docker # Production image, copy all the files and run next -FROM node:16-alpine AS runner +FROM node:18-alpine AS runner WORKDIR /app ENV NODE_ENV production From e31f88233310effea3f1777e5fa4522946ab2367 Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 20:45:46 +0100 Subject: [PATCH 5/9] Prisma requires linux/amd64.... --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 545d54cf..35ee7b59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Install dependencies only when needed -FROM node:18-alpine AS deps +FROM --platform=linux/amd64 node:18-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app @@ -25,7 +25,7 @@ ENV NEXT_TELEMETRY_DISABLED 1 RUN yarn build-docker # Production image, copy all the files and run next -FROM node:18-alpine AS runner +FROM --platform=linux/amd64 node:18-alpine AS runner WORKDIR /app ENV NODE_ENV production From 0ec20d42cf3920c71b6027443c09fac7f7d4e29b Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 21:03:14 +0100 Subject: [PATCH 6/9] Removed platform issues --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 35ee7b59..3fc32e0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Install dependencies only when needed -FROM --platform=linux/amd64 node:18-alpine AS deps +FROM node:18-alpine AS deps # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. RUN apk add --no-cache libc6-compat WORKDIR /app @@ -9,7 +9,7 @@ RUN yarn config set network-timeout 300000 RUN yarn install --frozen-lockfile # Rebuild the source code only when needed -FROM --platform=linux/amd64 node:18-alpine AS builder +FROM node:18-alpine AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . @@ -25,7 +25,7 @@ ENV NEXT_TELEMETRY_DISABLED 1 RUN yarn build-docker # Production image, copy all the files and run next -FROM --platform=linux/amd64 node:18-alpine AS runner +FROM node:18-alpine AS runner WORKDIR /app ENV NODE_ENV production From 61732f391ed23cf54fa90ddbb964790e95ce3538 Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 23:32:44 +0100 Subject: [PATCH 7/9] Updated Prisma version to support ARM64 --- package.json | 4 ++-- yarn.lock | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 395d311f..a01b8271 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ }, "dependencies": { "@fontsource/inter": "4.5.7", - "@prisma/client": "4.9.0", + "@prisma/client": "4.11.0", "chalk": "^4.1.1", "chart.js": "^2.9.4", "classnames": "^2.3.1", @@ -126,7 +126,7 @@ "postcss-preset-env": "7.4.3", "postcss-rtlcss": "^3.6.1", "prettier": "^2.6.2", - "prisma": "4.9.0", + "prisma": "4.11.0", "prompts": "2.4.2", "rollup": "^2.70.1", "rollup-plugin-terser": "^7.0.2", diff --git a/yarn.lock b/yarn.lock index 26ed75c6..a2c9a727 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1704,22 +1704,22 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@prisma/client@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.9.0.tgz#4a4068f3540732ea5723c008d49ed684d20f9340" - integrity sha512-bz6QARw54sWcbyR1lLnF2QHvRW5R/Jxnbbmwh3u+969vUKXtBkXgSgjDA85nji31ZBlf7+FrHDy5x+5ydGyQDg== +"@prisma/client@4.11.0": + version "4.11.0" + resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.11.0.tgz#41d5664dea4172c954190a432f70b86d3e2e629b" + integrity sha512-0INHYkQIqgAjrt7NzhYpeDQi8x3Nvylc2uDngKyFDDj1tTRQ4uV1HnVmd1sQEraeVAN63SOK0dgCKQHlvjL0KA== dependencies: - "@prisma/engines-version" "4.9.0-42.ceb5c99003b99c9ee2c1d2e618e359c14aef2ea5" + "@prisma/engines-version" "4.11.0-57.8fde8fef4033376662cad983758335009d522acb" -"@prisma/engines-version@4.9.0-42.ceb5c99003b99c9ee2c1d2e618e359c14aef2ea5": - version "4.9.0-42.ceb5c99003b99c9ee2c1d2e618e359c14aef2ea5" - resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.9.0-42.ceb5c99003b99c9ee2c1d2e618e359c14aef2ea5.tgz#9d817a5779fc05b107eb02f63d197ad296d60b3c" - integrity sha512-M16aibbxi/FhW7z1sJCX8u+0DriyQYY5AyeTH7plQm9MLnURoiyn3CZBqAyIoQ+Z1pS77usCIibYJWSgleBMBA== +"@prisma/engines-version@4.11.0-57.8fde8fef4033376662cad983758335009d522acb": + version "4.11.0-57.8fde8fef4033376662cad983758335009d522acb" + resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-4.11.0-57.8fde8fef4033376662cad983758335009d522acb.tgz#74af5ff56170c78e93ce46c56510160f58cd3c01" + integrity sha512-3Vd8Qq06d5xD8Ch5WauWcUUrsVPdMC6Ge8ILji8RFfyhUpqon6qSyGM0apvr1O8n8qH8cKkEFqRPsYjuz5r83g== -"@prisma/engines@4.9.0": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.9.0.tgz#05a1411964e047c1bc43f777c7a1c69f86a2a26c" - integrity sha512-t1pt0Gsp+HcgPJrHFc+d/ZSAaKKWar2G/iakrE07yeKPNavDP3iVKPpfXP22OTCHZUWf7OelwKJxQgKAm5hkgw== +"@prisma/engines@4.11.0": + version "4.11.0" + resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-4.11.0.tgz#c99749bfe20f58e8f4d2b5e04fee0785eba440e1" + integrity sha512-0AEBi2HXGV02cf6ASsBPhfsVIbVSDC9nbQed4iiY5eHttW9ZtMxHThuKZE1pnESbr8HRdgmFSa/Kn4OSNYuibg== "@react-spring/animated@~9.5.2": version "9.5.2" @@ -6138,12 +6138,12 @@ pretty-bytes@^5.6.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -prisma@4.9.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.9.0.tgz#295954b2a89cd35a0e6bcf66b2b036dbf80c75ee" - integrity sha512-bS96oZ5oDFXYgoF2l7PJ3Mp1wWWfLOo8B/jAfbA2Pn0Wm5Z/owBHzaMQKS3i1CzVBDWWPVnOohmbJmjvkcHS5w== +prisma@4.11.0: + version "4.11.0" + resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.11.0.tgz#9695ba4129a43eab3e76b5f7a033c6c020377725" + integrity sha512-4zZmBXssPUEiX+GeL0MUq/Yyie4ltiKmGu7jCJFnYMamNrrulTBc+D+QwAQSJ01tyzeGHlD13kOnqPwRipnlNw== dependencies: - "@prisma/engines" "4.9.0" + "@prisma/engines" "4.11.0" progress@^2.0.0: version "2.0.3" From 403144eb30e3adfe12ea31dde9272a9c8b9b87de Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 23:36:16 +0100 Subject: [PATCH 8/9] Added ^ to Prisma version package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a01b8271..f4d52dfa 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ }, "dependencies": { "@fontsource/inter": "4.5.7", - "@prisma/client": "4.11.0", + "@prisma/client": "^4.11.0", "chalk": "^4.1.1", "chart.js": "^2.9.4", "classnames": "^2.3.1", @@ -126,7 +126,7 @@ "postcss-preset-env": "7.4.3", "postcss-rtlcss": "^3.6.1", "prettier": "^2.6.2", - "prisma": "4.11.0", + "prisma": "^4.11.0", "prompts": "2.4.2", "rollup": "^2.70.1", "rollup-plugin-terser": "^7.0.2", From 3a18e79d45e28a739c209bc7357acdba96227637 Mon Sep 17 00:00:00 2001 From: BE-CH Date: Sun, 12 Mar 2023 23:37:54 +0100 Subject: [PATCH 9/9] Updated lockfile to support ^ --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index a2c9a727..6f1ec002 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1704,7 +1704,7 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@prisma/client@4.11.0": +"@prisma/client@^4.11.0": version "4.11.0" resolved "https://registry.yarnpkg.com/@prisma/client/-/client-4.11.0.tgz#41d5664dea4172c954190a432f70b86d3e2e629b" integrity sha512-0INHYkQIqgAjrt7NzhYpeDQi8x3Nvylc2uDngKyFDDj1tTRQ4uV1HnVmd1sQEraeVAN63SOK0dgCKQHlvjL0KA== @@ -6138,7 +6138,7 @@ pretty-bytes@^5.6.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -prisma@4.11.0: +prisma@^4.11.0: version "4.11.0" resolved "https://registry.yarnpkg.com/prisma/-/prisma-4.11.0.tgz#9695ba4129a43eab3e76b5f7a033c6c020377725" integrity sha512-4zZmBXssPUEiX+GeL0MUq/Yyie4ltiKmGu7jCJFnYMamNrrulTBc+D+QwAQSJ01tyzeGHlD13kOnqPwRipnlNw==