Updated Dockerfile
All checks were successful
build / build (push) Successful in 28s

This commit is contained in:
Richard Robert Reitz 2025-08-28 15:16:43 +02:00
parent addc3725ea
commit 68dd2dff35
2 changed files with 115 additions and 64 deletions

View file

@ -1,66 +1,5 @@
# SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors FROM nginx
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Multistage build to reduce image size and increase security RUN rm -rf /usr/share/nginx/html/*
FROM node:lts-slim AS build
# Create folder for CryptPad COPY --chmod=644 index.html /usr/share/nginx/html/
RUN mkdir /cryptpad
WORKDIR /cryptpad
# Copy CryptPad source code to the container
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
# Install dependencies
RUN npm install --production \
&& npm run install:components
# Create actual CryptPad image
FROM node:lts-slim
ENV DEBIAN_FRONTEND=noninteractive
# Create user and group for CryptPad so it does not run as root
RUN groupadd cryptpad -g 4001
RUN useradd cryptpad -u 4001 -g 4001 -d /cryptpad
# 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 --chown=cryptpad /cryptpad /cryptpad
USER cryptpad
# Copy docker-entrypoint.sh script
COPY --chown=cryptpad docker-entrypoint.sh /cryptpad/docker-entrypoint.sh
# Set workdir to cryptpad
WORKDIR /cryptpad
# Create directories
RUN mkdir blob block customize data datastore
# Volumes for data persistence
VOLUME /cryptpad/blob
VOLUME /cryptpad/block
VOLUME /cryptpad/customize
VOLUME /cryptpad/data
VOLUME /cryptpad/datastore
ENTRYPOINT ["/bin/bash", "/cryptpad/docker-entrypoint.sh"]
# Healthcheck
HEALTHCHECK --interval=1m CMD curl -f http://localhost:3000/ || exit 1
# Ports
EXPOSE 3000 3003
# Run cryptpad on startup
CMD ["npm", "start"]

112
index.html Normal file
View file

@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EDP meets Edge Connect</title>
<!--
The following script loads Tailwind CSS, which is used for rapid styling.
The CSS below uses basic selectors to demonstrate how to achieve the
requested layout without relying solely on a framework.
-->
<style>
/* This applies a smooth, rounded border to all elements. */
* {
border-radius: 0.5rem;
}
/*
The body is a flex container to center its child element.
- display: flex makes it a flexible box container.
- justify-content: center centers the child horizontally.
- align-items: center centers the child vertically.
- min-height: 100vh ensures the body takes up the full viewport height.
- background-color: black sets the background color as requested.
- color: magenta sets the text color for the entire body as requested.
*/
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: black;
color: #e20074;
font-family: 'Inter', sans-serif;
margin: 0;
padding: 1rem;
}
/*
This container holds both the image and the text.
- It uses flexbox to arrange the items in a row.
- align-items: center vertically aligns the image and the text.
- The gap adds space between the image and the text.
- max-width prevents the content from stretching too wide on large screens.
- The padding adds some space inside the container.
*/
.content-container {
align-items: center;
flex-wrap: wrap; /* Allows wrapping on smaller screens */
gap: 2rem;
max-width: 90%;
padding: 1.5rem;
text-align: center;
justify-content: center;
}
/*
The image styling.
- max-width ensures the image is responsive.
- height: auto maintains the aspect ratio.
*/
.content-container img {
width: 150px;
height: auto;
}
/*
The text styling.
- font-size: 6rem makes the text very large.
- font-weight: bold makes the text stand out.
- line-height ensures there is enough space around the text.
*/
.content-container h1 {
font-size: clamp(3rem, 10vw, 6rem); /* Responsive font size */
font-weight: bold;
line-height: 1;
margin: 0;
}
/*
This media query adjusts the layout for smaller screens.
- It changes the flex direction to column, stacking the image and text.
- The text alignment is centered.
*/
@media (max-width: 600px) {
.content-container {
flex-direction: column;
}
}
</style>
</head>
<body>
<div class="content-container">
<!--
This is a placeholder image. You should replace the 'src'
attribute with the URL of your own image. The `onerror`
attribute provides a fallback in case the image fails to load.
-->
<img
src="https://edp.buildth.ing/assets/img/logo.svg"
>
<br />
<!-- The main heading text, styled to be large and centered -->
<h1>EDP meets Edge Connect</h1>
</div>
</body>
</html>