From 0ad95d00dc5f6ee1c1defd2bc919fe99b7442652 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 29 Oct 2025 08:08:16 +0200 Subject: [PATCH] chore(ci): try to fix arm v6/v7 build --- .github/workflows/main-docker.yml | 4 ++-- apps/server/Dockerfile.legacy | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 apps/server/Dockerfile.legacy diff --git a/.github/workflows/main-docker.yml b/.github/workflows/main-docker.yml index f020a04a1..fab20d242 100644 --- a/.github/workflows/main-docker.yml +++ b/.github/workflows/main-docker.yml @@ -116,10 +116,10 @@ jobs: - dockerfile: Dockerfile platform: linux/arm64 image: ubuntu-24.04-arm - - dockerfile: Dockerfile + - dockerfile: Dockerfile.legacy platform: linux/arm/v7 image: ubuntu-24.04-arm - - dockerfile: Dockerfile + - dockerfile: Dockerfile.legacy platform: linux/arm/v8 image: ubuntu-24.04-arm runs-on: ${{ matrix.image }} diff --git a/apps/server/Dockerfile.legacy b/apps/server/Dockerfile.legacy new file mode 100644 index 000000000..8b2b4cb73 --- /dev/null +++ b/apps/server/Dockerfile.legacy @@ -0,0 +1,28 @@ +FROM node:22.21.0-bullseye-slim AS builder +RUN corepack enable + +# Install native dependencies since we might be building cross-platform. +WORKDIR /usr/src/app/build +COPY ./docker/package.json ./docker/pnpm-workspace.yaml /usr/src/app/ +# We have to use --no-frozen-lockfile due to CKEditor patches +RUN pnpm install --no-frozen-lockfile --prod && pnpm rebuild + +FROM node:24.10.0-bullseye-slim +# Install only runtime dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + gosu && \ + rm -rf \ + /var/lib/apt/lists/* \ + /var/cache/apt/* + +WORKDIR /usr/src/app +COPY ./dist /usr/src/app +RUN rm -rf /usr/src/app/node_modules/better-sqlite3 +COPY --from=builder /usr/src/app/node_modules/better-sqlite3 /usr/src/app/node_modules/better-sqlite3 +COPY ./start-docker.sh /usr/src/app + +# Configure container +EXPOSE 8080 +CMD [ "sh", "./start-docker.sh" ] +HEALTHCHECK --start-period=10s CMD exec gosu node node /usr/src/app/docker_healthcheck.cjs \ No newline at end of file