From c7003700cfc183d5db6d8d6c08442e55cc100ed0 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Thu, 3 Sep 2026 10:53:56 +0200 Subject: [PATCH] fix(docker): switch back to debian for glibc + remove localhost from infra --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6c7be3878..41a8c3f81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # Multistage build to reduce image size and increase security -FROM node:lts-alpine AS build +FROM node:lts-slim AS build # Create folder for CryptPad RUN mkdir /cryptpad @@ -14,20 +14,25 @@ COPY . /cryptpad RUN sed -i "s@//httpAddress: 'localhost'@httpAddress: '0.0.0.0'@" /cryptpad/config/config.example.js RUN sed -i "s@installMethod: 'unspecified'@installMethod: 'docker'@" /cryptpad/config/config.example.js +RUN sed -i 's@host: "localhost"@host: "0.0.0.0"@' /cryptpad/config/infra.example.js # Install dependencies RUN npm install --production \ && npm run install:components # Create actual CryptPad image -FROM node:lts-alpine +FROM node:lts-slim +ENV DEBIAN_FRONTEND=noninteractive # Create user and group for CryptPad so it does not run as root -RUN addgroup -S cryptpad -g 4001 && adduser -S cryptpad -G cryptpad --uid 4001 -h /cryptpad +RUN groupadd cryptpad -g 4001 && useradd cryptpad -u 4001 -g 4001 -d /cryptpad # Install curl for healthcheck # Install git, rdfind and unzip for install-onlyoffice.sh -RUN apk add --no-cache ca-certificates git rdfind unzip bash curl +RUN apt-get update && apt-get install --no-install-recommends -y \ + curl ca-certificates git rdfind unzip && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Copy cryptpad with installed modules COPY --from=build --chown=cryptpad /cryptpad /cryptpad