Skip to content

Commit 41a846c

Browse files
authored
Merge branch 'main' into andrea/add-design-tokens-storybook
2 parents b658dbd + 4b993dd commit 41a846c

40 files changed

+1274
-751
lines changed

client/Dockerfile

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,20 @@ RUN npm ci --omit=dev
3434

3535
FROM node:22-slim
3636

37-
RUN apt-get update && apt-get upgrade --quiet --assume-yes
37+
RUN apt-get update && \
38+
apt-get upgrade --quiet --assume-yes && \
39+
apt-get install tini && \
40+
rm -rf /var/lib/apt/lists/*
3841

3942
USER node
4043

4144
WORKDIR /app
4245

4346
COPY package.json package-lock.json server.js /app/
47+
COPY server/constants.js /app/server/constants.js
4448
COPY --from=dependencies /app/node_modules /app/node_modules
4549
COPY --from=builder /app/build /app/build
4650
COPY --from=builder /app/storybook-static /app/storybook-static
47-
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
48-
COPY scripts/generate_sitemap.sh /app/scripts/generate_sitemap.sh
49-
50-
# Set up the config files written by docker-entrypoint
51-
USER root
52-
RUN touch /app/build/client/config.json
53-
RUN chmod a+r /app/build/client/config.json
54-
RUN chown node /app/build/client/config.json
55-
56-
RUN touch /app/build/client/robots.txt
57-
RUN chmod a+r /app/build/client/robots.txt
58-
RUN chown node /app/build/client/robots.txt
59-
60-
RUN touch /app/build/client/sitemap.xml
61-
RUN chmod a+r /app/build/client/sitemap.xml
62-
RUN chown node /app/build/client/sitemap.xml
63-
64-
RUN touch /app/build/client/privacy-statement.md
65-
RUN chmod a+r /app/build/client/privacy-statement.md
66-
RUN chown node /app/build/client/privacy-statement.md
67-
68-
RUN touch /app/build/client/terms-of-use.md
69-
RUN chmod a+r /app/build/client/terms-of-use.md
70-
RUN chown node /app/build/client/terms-of-use.md
7151

7252
USER node
7353

@@ -76,5 +56,6 @@ ENV PORT=8080
7656
ARG SHORT_SHA
7757
ENV RENKU_UI_SHORT_SHA=$SHORT_SHA
7858

79-
ENTRYPOINT ["/bin/bash", "/app/docker-entrypoint.sh"]
59+
# NOTE: Without tini the node process does not respond to interrupt signals to stop
60+
ENTRYPOINT ["tini", "-g", "--"]
8061
CMD ["node", "/app/server.js"]

client/docker-entrypoint.sh

Lines changed: 0 additions & 116 deletions
This file was deleted.

client/nginx.vh.default.conf

Lines changed: 0 additions & 84 deletions
This file was deleted.

client/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "renku-ui",
3-
"version": "4.1.0",
3+
"version": "4.2.0",
44
"private": true,
55
"scripts": {
66
"start": "react-router dev --port 3000",

client/scripts/generate_sitemap.sh

Lines changed: 0 additions & 49 deletions
This file was deleted.

client/server.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import compression from "compression";
22
import express from "express";
33
import morgan from "morgan";
4+
import {
5+
CONFIG_JSON,
6+
ROBOTS,
7+
SAMPLE_PRIVACY_CONTENT,
8+
SAMPLE_TERMS_CONTENT,
9+
SITEMAP,
10+
} from "./server/constants.js";
411

512
const BUILD_PATH = "./build/server/index.js";
613
const DEVELOPMENT = process.env.NODE_ENV === "development";
@@ -26,6 +33,30 @@ app.use(
2633
express.static("build/client/assets", { immutable: true, maxAge: "1y" })
2734
);
2835

36+
//Configuration and miscellaneous files
37+
app.get("/config.json", (_, res) => {
38+
res.json(CONFIG_JSON);
39+
});
40+
app.get("/sitemap.xml", (_, res) => {
41+
res.setHeader("Content-Type", "application/xml");
42+
res.send(SITEMAP);
43+
});
44+
app.get("/robots.txt", (_, res) => {
45+
res.send(ROBOTS);
46+
});
47+
if (CONFIG_JSON.TERMS_PAGES_ENABLED) {
48+
app.get("/terms-of-use.md", (_, res) => {
49+
CONFIG_JSON.TERMS_CONTENT.length > 0
50+
? res.send(CONFIG_JSON.TERMS_CONTENT)
51+
: res.send(SAMPLE_TERMS_CONTENT);
52+
});
53+
app.get("/privacy-statement.md", (_, res) => {
54+
CONFIG_JSON.PRIVACY_CONTENT.length > 0
55+
? res.send(CONFIG_JSON.PRIVACY_CONTENT)
56+
: res.send(SAMPLE_PRIVACY_CONTENT);
57+
});
58+
}
59+
2960
// Logging
3061
app.use(morgan("tiny"));
3162

0 commit comments

Comments
 (0)