diff options
author | Armaël Guéneau <armael.gueneau@ens-lyon.org> | 2024-11-07 23:21:50 +0100 |
---|---|---|
committer | Armaël Guéneau <armael.gueneau@ens-lyon.org> | 2024-11-07 23:26:12 +0100 |
commit | f32c0c34f345fb61646dcab87db4c2ab6dbb23be (patch) | |
tree | cc41f8d8428c00fd0d16c33c34066f70dba5139b /cluster/prod/app/cryptpad/build_docker | |
parent | bc49f33d6547e1eb70b278f0e7c4045ab45710a0 (diff) | |
download | nixcfg-f32c0c34f345fb61646dcab87db4c2ab6dbb23be.tar.gz nixcfg-f32c0c34f345fb61646dcab87db4c2ab6dbb23be.zip |
cryptpad-debug: essai avec un Dockerfile basique plutôt que construit par nix
Diffstat (limited to 'cluster/prod/app/cryptpad/build_docker')
-rw-r--r-- | cluster/prod/app/cryptpad/build_docker/Dockerfile | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/cluster/prod/app/cryptpad/build_docker/Dockerfile b/cluster/prod/app/cryptpad/build_docker/Dockerfile new file mode 100644 index 0000000..0987521 --- /dev/null +++ b/cluster/prod/app/cryptpad/build_docker/Dockerfile @@ -0,0 +1,59 @@ +# SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors +# +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# Tweaks by Deuxfleurs + +# Multistage build to reduce image size and increase security +FROM node:lts-slim AS build +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates tar wget + +# Download the release tarball +RUN wget https://github.com/cryptpad/cryptpad/archive/refs/tags/2024.9.0.tar.gz -O cryptpad.tar.gz + +# Create folder for CryptPad +RUN mkdir /cryptpad + +# Extract the release into /cryptpad +RUN tar xvzf cryptpad.tar.gz -C /cryptpad --strip-components 1 + +# Go to /cryptpad +WORKDIR /cryptpad + +# Install dependencies +RUN npm install --production && npm run install:components + +# Create the actual CryptPad image +FROM node:lts-slim +ENV DEBIAN_FRONTEND=noninteractive + +# Install curl for healthcheck +# Install git, rdfind and unzip for install-onlyoffice.sh +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 /cryptpad /cryptpad + +# Set workdir to cryptpad +WORKDIR /cryptpad + +# Install onlyoffice +RUN ./install-onlyoffice.sh --accept-license --trust-repository + +# Build static pages (?) unsure we need this +RUN npm run build + +# Healthcheck +HEALTHCHECK --interval=1m CMD curl -f http://localhost:3000/ || exit 1 + +# Ports +EXPOSE 3000 3003 + +# Run cryptpad on startup +CMD ["npm", "start"] |