From 905cc665f81a48ca05c320ee72efb5c38385f3da Mon Sep 17 00:00:00 2001 From: sup39 Date: Thu, 7 Mar 2024 19:52:02 +0900 Subject: [PATCH 1/5] container: use node-alpine image --- Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e1381eb45..1ab0c9a7db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ ## Install dev and compilation dependencies, build files -FROM docker.io/node:20-slim as build +FROM docker.io/node:20-alpine as build WORKDIR /firefish # Install compilation dependencies -RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends curl build-essential ca-certificates python3 +RUN apk update && apk add build-base curl ca-certificates python3 RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -44,14 +44,11 @@ RUN NODE_ENV='production' pnpm run --recursive --parallel --filter '!backend-rs' RUN find . -path '*/node_modules/*' -delete && pnpm install --prod --frozen-lockfile ## Runtime container -FROM docker.io/node:20-slim +FROM docker.io/node:20-alpine WORKDIR /firefish # Install runtime dependencies -RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends zip unzip tini ffmpeg ca-certificates - -RUN echo 'deb https://deb.debian.org/debian experimental main' | tee /etc/apt/sources.list -RUN apt-get update && DEBIAN_FRONTEND='noninteractive' apt-get --target-release experimental install -y --no-install-recommends libc6 +RUN apk update && apk add zip unzip tini ffmpeg COPY . ./ @@ -73,5 +70,5 @@ COPY --from=build /firefish/packages/backend-rs/built /firefish/packages/backend RUN corepack enable && corepack prepare pnpm@latest --activate ENV NODE_ENV=production VOLUME "/firefish/files" -ENTRYPOINT [ "/usr/bin/tini", "--" ] +ENTRYPOINT [ "/sbin/tini", "--" ] CMD [ "pnpm", "run", "start:container" ] From 18c50f966999b58d00caf91fec07ca55def617e0 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 7 Mar 2024 20:24:39 +0900 Subject: [PATCH 2/5] container: add --no-cache option to apk add --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ab0c9a7db..df54502a9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM docker.io/node:20-alpine as build WORKDIR /firefish # Install compilation dependencies -RUN apk update && apk add build-base curl ca-certificates python3 +RUN apk update && apk add --no-cache build-base curl ca-certificates python3 RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" @@ -48,7 +48,7 @@ FROM docker.io/node:20-alpine WORKDIR /firefish # Install runtime dependencies -RUN apk update && apk add zip unzip tini ffmpeg +RUN apk update && apk add --no-cache zip unzip tini ffmpeg COPY . ./ From 9661b6b86de93c9d9d2e11c49f835f3129230797 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 7 Mar 2024 21:11:52 +0900 Subject: [PATCH 3/5] fix (container): add linux-headers to build dependencies --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df54502a9d..9117d71900 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM docker.io/node:20-alpine as build WORKDIR /firefish # Install compilation dependencies -RUN apk update && apk add --no-cache build-base curl ca-certificates python3 +RUN apk update && apk add --no-cache build-base linux-headers curl ca-certificates python3 RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" From 95bab740c4126713630fc1af2c4b8a0cfd42cb6f Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 7 Mar 2024 21:23:06 +0900 Subject: [PATCH 4/5] refactor (container): remove config file that doesn't work properly --- packages/backend-rs/.cargo/config.toml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/backend-rs/.cargo/config.toml diff --git a/packages/backend-rs/.cargo/config.toml b/packages/backend-rs/.cargo/config.toml deleted file mode 100644 index 7ede30ee04..0000000000 --- a/packages/backend-rs/.cargo/config.toml +++ /dev/null @@ -1,3 +0,0 @@ -[target.aarch64-unknown-linux-musl] -linker = "aarch64-linux-musl-gcc" -rustflags = ["-C", "target-feature=-crt-static"] \ No newline at end of file From 25bb1125ace056f6f9e2ddc08fa08e066d8b181f Mon Sep 17 00:00:00 2001 From: naskya Date: Sat, 23 Mar 2024 22:06:23 +0900 Subject: [PATCH 5/5] docs: note that base image has changed --- docs/notice-for-admins.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/notice-for-admins.md b/docs/notice-for-admins.md index 12076730e7..6c34ce25c0 100644 --- a/docs/notice-for-admins.md +++ b/docs/notice-for-admins.md @@ -2,6 +2,12 @@ You can skip intermediate versions when upgrading from an old version, but please read the notices and follow the instructions for each intermediate version before [upgrading](./upgrade.md). +## Unreleased + +### For Docker/Podman users + +The Firefish OCI container image is now based on [`docker.io/node:20-alpine`](https://hub.docker.com/layers/library/node/20-alpine/images/sha256-121edf6661770d20483818426b32042da33323b6fd30fc1ad4cd6890a817e240) (migrated from Debian to Alpine). This is a notification only and no action is required. + ## v20240319 The full-text search engine used in Firefish has been changed to [PGroonga](https://pgroonga.github.io/). This is no longer an optional feature, so please enable PGroonga on your system. If you are using Sonic, Meilisearch, or Elasticsearch, you can also uninstall it from your system and remove the settings from `.config/default.yml`.