From 830d111eef4f5a81b3fd4ae3fdecfb9b9ca681f7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:25:45 +0000 Subject: [PATCH 01/11] Initial plan From 975a61c9a5ad7267c8ea66f6a02fe08528cf6e71 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 20:28:52 +0000 Subject: [PATCH 02/11] Add central multi-stage Dockerfile for all tool services Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com> Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/b6ab5268-aa41-46be-9015-ddb9c14527a4 --- Dockerfile | 317 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70e53f7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,317 @@ +# syntax=docker/dockerfile:1 +# +# Central multi-stage Dockerfile for all tool services. +# +# A single Maven build stage compiles every tool module so that Maven runs +# only once and Docker can cache the result across all subsequent stages. +# +# Build a specific tool service by targeting the appropriate stage, e.g.: +# docker build --target toolservice-emf -t emf-tool . +# docker build --target toolservice-emfatic -t emfatic-tool . +# docker build --target toolservice-ocl -t ocl-tool . +# docker build --target toolservice-conversion -t conversion-tool . +# docker build --target toolservice-xtext -t xtext-tool . + +# --------------------------------------------------------------------------- +# Stage 1 – Maven build (all modules built in a single invocation) +# --------------------------------------------------------------------------- +FROM maven:3.8.5-openjdk-17 AS mavenbuilder + +COPY services /usr/src/toolfunctions + +WORKDIR /usr/src/toolfunctions + +RUN mvn clean install -Pall + +# Get runtime dependencies used by the tool-runner stages +RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get \ + -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 \ + && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get \ + -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 + + +# --------------------------------------------------------------------------- +# Stage 2a – Static frontend build for EMF +# --------------------------------------------------------------------------- +FROM node:19-bullseye AS staticbuild-emf + +WORKDIR /usr/src/mdenet-tool + +COPY static.emf/package*.json ./ +COPY static.emf . + +RUN npm install; npm run build; chmod -R 755 dist/ + + +# --------------------------------------------------------------------------- +# Stage 2b – Static frontend build for Emfatic +# --------------------------------------------------------------------------- +FROM node:19-bullseye AS staticbuild-emfatic + +WORKDIR /usr/src/mdenet-tool + +COPY static.emfatic/package*.json ./ +COPY static.emfatic . + +RUN npm install; npm run build; chmod -R 755 dist/ + + +# --------------------------------------------------------------------------- +# Stage 2c – Static frontend build for OCL +# --------------------------------------------------------------------------- +FROM node:19-bullseye AS staticbuild-ocl + +WORKDIR /usr/src/mdenet-tool + +COPY static.ocl/package*.json ./ +COPY static.ocl . + +RUN npm install; npm run build; chmod -R 755 dist/ + + +# --------------------------------------------------------------------------- +# Stage 2d – Static frontend build for Conversion (Epsilon) +# --------------------------------------------------------------------------- +FROM node:19-bullseye AS staticbuild-conversion + +WORKDIR /usr/src/mdenet-tool + +COPY static.conversion/package*.json ./ +COPY static.conversion . + +RUN npm install; npm run build; chmod -R 755 dist/ + + +# --------------------------------------------------------------------------- +# Stage 2e – Static frontend build for Xtext +# --------------------------------------------------------------------------- +FROM node:19-bullseye AS staticbuild-xtext + +ARG TRUSTED_ORIGINS + +RUN apt-get update && apt-get install -y --no-install-recommends zip + +WORKDIR /usr/src/mdenet-tool + +COPY xtext/static.xtext/package*.json ./ +COPY xtext/static.xtext . + +RUN npm install; npm run build; chmod -R 755 dist/ + +# CORS configuration for webapp +COPY xtext/acemodebundler/web.xml /usr/src/mdenet-tool/dist/WEB-INF/web.xml + +RUN sed -i "s|http://127.0.0.1:8080|$TRUSTED_ORIGINS|g" /usr/src/mdenet-tool/dist/WEB-INF/web.xml + +RUN cd dist && zip -r ROOT.war . + + +# --------------------------------------------------------------------------- +# Stage 3a – EMF tool service +# --------------------------------------------------------------------------- +FROM nginx:1.24.0-bullseye AS toolservice-emf + +# Needed to avoid prompts blocking the build process +ENV DEBIAN_FRONTEND=noninteractive + +# Needed for Cloud Build +ENV PORT=80 + +RUN apt-get update \ + && apt-get install -y python3-minimal maven tini netcat \ + && rm -rf /var/lib/apt/lists/* + +# Copy built tool and sources +COPY --from=mavenbuilder /root/.m2 /root/.m2 +COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice + +# Copy files for webserver +COPY static.emf/nginx.conf.template /etc/nginx.conf.template + +RUN rm -r /usr/share/nginx/html/* +COPY --from=staticbuild-emf /usr/src/mdenet-tool/dist /usr/share/nginx/html + +WORKDIR /toolservice + +# Copy start script and make it executable +ADD static.emf/start.sh / +RUN chmod +x /start.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] + + +# --------------------------------------------------------------------------- +# Stage 3b – Emfatic tool service +# --------------------------------------------------------------------------- +FROM nginx:1.24.0-bullseye AS toolservice-emfatic + +ENV DEBIAN_FRONTEND=noninteractive +ENV PORT=80 + +RUN apt-get update \ + && apt-get install -y python3-minimal maven tini netcat \ + && rm -rf /var/lib/apt/lists/* + +# Copy built tool and sources +COPY --from=mavenbuilder /root/.m2 /root/.m2 +COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice + +# Copy files for webserver +COPY static.emfatic/nginx.conf.template /etc/nginx.conf.template + +RUN rm -r /usr/share/nginx/html/* +COPY --from=staticbuild-emfatic /usr/src/mdenet-tool/dist /usr/share/nginx/html + +WORKDIR /toolservice + +ADD static.emfatic/start.sh / +RUN chmod +x /start.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] + + +# --------------------------------------------------------------------------- +# Stage 3c – OCL tool service +# --------------------------------------------------------------------------- +FROM nginx:1.24.0-bullseye AS toolservice-ocl + +ENV DEBIAN_FRONTEND=noninteractive +ENV PORT=80 + +RUN apt-get update \ + && apt-get install -y python3-minimal openjdk-17-jdk maven tini netcat \ + && rm -rf /var/lib/apt/lists/* + +# Copy built tool and sources +COPY --from=mavenbuilder /root/.m2 /root/.m2 +COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice + +# Copy files for webserver +COPY static.ocl/nginx.conf.template /etc/nginx.conf.template + +RUN rm -r /usr/share/nginx/html/* +COPY --from=staticbuild-ocl /usr/src/mdenet-tool/dist /usr/share/nginx/html + +WORKDIR /toolservice + +ADD static.ocl/start.sh / +RUN chmod +x /start.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] + + +# --------------------------------------------------------------------------- +# Stage 3d – Conversion (Epsilon) tool service +# --------------------------------------------------------------------------- +FROM nginx:1.24.0-bullseye AS toolservice-conversion + +ENV DEBIAN_FRONTEND=noninteractive +ENV PORT=80 + +RUN apt-get update \ + && apt-get install -y python3-minimal maven tini netcat \ + && rm -rf /var/lib/apt/lists/* + +# Copy tool sources +COPY services/epsilon /toolservice + +# Copy additional built tool and sources +COPY --from=mavenbuilder /root/.m2 /root/.m2 +COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice-add + +# Copy files for webserver +COPY static.conversion/nginx.conf.template /etc/nginx.conf.template + +RUN rm -r /usr/share/nginx/html/* +COPY --from=staticbuild-conversion /usr/src/mdenet-tool/dist /usr/share/nginx/html + +WORKDIR /toolservice + +# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p +# is not a practical solution for ensuring all dependencies are available. +# +# We use https://github.com/qaware/go-offline-maven-plugin instead. +RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies + +ADD static.conversion/start.sh / +RUN chmod +x /start.sh + +ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] + + +# --------------------------------------------------------------------------- +# Stage 3e – Xtext tool service +# --------------------------------------------------------------------------- +FROM tomcat:9.0.76-jdk17-temurin AS toolservice-xtext + +# See https://github.com/mdenet/educationplatform-docker/blob/main/README.md#environment-variables +ARG ES_ADDRESS +ARG ES_DEPLOY_ADDRESS + +# toolservice main endpoint port +ENV TS_PORT=9000 +# editor server internal port +ENV ES_PORT=10001 + +ENV INSTALL_DIR=/usr/local + +# Paths for editor builds +ENV ES_DIR=/editorserver +ENV ES_BUILD_LOCATION=${ES_DIR}/build +ENV ES_UPLOAD_LOCATION=${ES_DIR}/uploads +ENV ES_DEPLOY_FILE_LOCATION=${CATALINA_HOME}/webapps + +# The release of node to install +ENV NODE_VERSION=19.9.0 + +RUN apt-get update && apt-get install -y --no-install-recommends unzip zip xz-utils maven cron psmisc + +# Install node (detect architecture for arm64/x64 compatibility) +WORKDIR $INSTALL_DIR +RUN ARCH=$(dpkg --print-architecture) \ + && if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then NODE_ARCH="linux-arm64"; else NODE_ARCH="linux-x64"; fi \ + && NODE_RELEASE="node-v${NODE_VERSION}-${NODE_ARCH}" \ + && echo "Installing ${NODE_RELEASE}" \ + && curl --output ${NODE_RELEASE}.tar.xz https://nodejs.org/download/release/v${NODE_VERSION}/${NODE_RELEASE}.tar.xz \ + && tar -xf ${NODE_RELEASE}.tar.xz \ + && ln -s ${INSTALL_DIR}/${NODE_RELEASE} ${INSTALL_DIR}/node +ENV PATH="$INSTALL_DIR/node/bin:${PATH}" + +WORKDIR /usr/src/toolfunctions + +# Copy built tool and sources +COPY --from=mavenbuilder /root/.m2 /root/.m2 +COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice + +COPY xtext/acemodebundler /acemodebundler +COPY xtext/editorserver ${ES_DIR} + +WORKDIR /acemodebundler + +RUN npm ci + +WORKDIR ${ES_DIR} + +RUN npm ci --omit=dev + +EXPOSE ${ES_PORT} +EXPOSE ${TS_PORT} +# 8080 is the default tomcat public port +EXPOSE 8080 + +COPY xtext/start.sh ${ES_DIR}/start.sh +COPY xtext/cron-setup.sh ${ES_DIR}/cron-setup.sh + +RUN chmod +x ${ES_DIR}/start.sh +RUN chmod +x ${ES_DIR}/cron-setup.sh + +# deploy tool static files +COPY --from=staticbuild-xtext /usr/src/mdenet-tool/dist/ROOT.war ${ES_DEPLOY_FILE_LOCATION}/ROOT.war + +# Cron time for scheduled stop +ENV XTEXT_ES_STOP_CRON_TIME="* 4 * * *" + +# setup cron job to periodically stop the server +RUN ./cron-setup.sh + +ENTRYPOINT [ "/bin/bash", "start.sh" ] From f1b606242f3666d724219fc7714f18e0018fdc64 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:01:59 +0000 Subject: [PATCH 03/11] Scope Maven artifact copies to only the modules required per tool Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com> Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/e691f0eb-fb24-4c42-8fd9-8ba24d1e203f --- Dockerfile | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 70e53f7..5c80105 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,9 +121,12 @@ RUN apt-get update \ && apt-get install -y python3-minimal maven tini netcat \ && rm -rf /var/lib/apt/lists/* -# Copy built tool and sources +# Copy built tool and sources (only the modules required for the emf profile) COPY --from=mavenbuilder /root/.m2 /root/.m2 -COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice +COPY --from=mavenbuilder /usr/src/toolfunctions/pom.xml /toolservice/pom.xml +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core /toolservice/com.mde-network.ep.toolfunctions.core +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf /toolservice/com.mde-network.ep.toolfunctions.emf +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emffunction /toolservice/com.mde-network.ep.toolfunctions.emffunction # Copy files for webserver COPY static.emf/nginx.conf.template /etc/nginx.conf.template @@ -152,9 +155,13 @@ RUN apt-get update \ && apt-get install -y python3-minimal maven tini netcat \ && rm -rf /var/lib/apt/lists/* -# Copy built tool and sources +# Copy built tool and sources (only the modules required for the emfatic profile) COPY --from=mavenbuilder /root/.m2 /root/.m2 -COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice +COPY --from=mavenbuilder /usr/src/toolfunctions/pom.xml /toolservice/pom.xml +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core /toolservice/com.mde-network.ep.toolfunctions.core +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf /toolservice/com.mde-network.ep.toolfunctions.emf +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emfatic /toolservice/com.mde-network.ep.toolfunctions.emfatic +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emfaticfunction /toolservice/com.mde-network.ep.toolfunctions.emfaticfunction # Copy files for webserver COPY static.emfatic/nginx.conf.template /etc/nginx.conf.template @@ -182,9 +189,12 @@ RUN apt-get update \ && apt-get install -y python3-minimal openjdk-17-jdk maven tini netcat \ && rm -rf /var/lib/apt/lists/* -# Copy built tool and sources +# Copy built tool and sources (only the modules required for the ocl profile) COPY --from=mavenbuilder /root/.m2 /root/.m2 -COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice +COPY --from=mavenbuilder /usr/src/toolfunctions/pom.xml /toolservice/pom.xml +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core /toolservice/com.mde-network.ep.toolfunctions.core +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.eclipseocl /toolservice/com.mde-network.ep.toolfunctions.eclipseocl +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.eclipseoclfunction /toolservice/com.mde-network.ep.toolfunctions.eclipseoclfunction # Copy files for webserver COPY static.ocl/nginx.conf.template /etc/nginx.conf.template @@ -215,9 +225,13 @@ RUN apt-get update \ # Copy tool sources COPY services/epsilon /toolservice -# Copy additional built tool and sources +# Copy additional built tool and sources (only the modules required for the epsilon profile) COPY --from=mavenbuilder /root/.m2 /root/.m2 -COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice-add +COPY --from=mavenbuilder /usr/src/toolfunctions/pom.xml /toolservice-add/pom.xml +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core /toolservice-add/com.mde-network.ep.toolfunctions.core +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf /toolservice-add/com.mde-network.ep.toolfunctions.emf +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.epsilon /toolservice-add/com.mde-network.ep.toolfunctions.epsilon +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.epsilonfunction /toolservice-add/com.mde-network.ep.toolfunctions.epsilonfunction # Copy files for webserver COPY static.conversion/nginx.conf.template /etc/nginx.conf.template @@ -279,9 +293,13 @@ ENV PATH="$INSTALL_DIR/node/bin:${PATH}" WORKDIR /usr/src/toolfunctions -# Copy built tool and sources +# Copy built tool and sources (only the modules required for the xtext profile) COPY --from=mavenbuilder /root/.m2 /root/.m2 -COPY --from=mavenbuilder /usr/src/toolfunctions /toolservice +COPY --from=mavenbuilder /usr/src/toolfunctions/pom.xml /toolservice/pom.xml +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core /toolservice/com.mde-network.ep.toolfunctions.core +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf /toolservice/com.mde-network.ep.toolfunctions.emf +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.xtext /toolservice/com.mde-network.ep.toolfunctions.xtext +COPY --from=mavenbuilder /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.xtextfunction /toolservice/com.mde-network.ep.toolfunctions.xtextfunction COPY xtext/acemodebundler /acemodebundler COPY xtext/editorserver ${ES_DIR} From 01cbd13b2559e2e466b01c812bbc5a0bd22a02aa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 17:38:23 +0000 Subject: [PATCH 04/11] Remove old per-tool Dockerfiles and update README with build instructions Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/7a50b9f8-7786-426b-9c41-57784673d87f Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com> --- README.md | 35 ++++++++++ static.conversion/Dockerfile | 78 --------------------- static.emf/Dockerfile | 73 -------------------- static.emfatic/Dockerfile | 74 -------------------- static.ocl/Dockerfile | 74 -------------------- xtext/Dockerfile | 123 ---------------------------------- xtext/static.xtext/Dockerfile | 73 -------------------- 7 files changed, 35 insertions(+), 495 deletions(-) delete mode 100644 static.conversion/Dockerfile delete mode 100644 static.emf/Dockerfile delete mode 100644 static.emfatic/Dockerfile delete mode 100644 static.ocl/Dockerfile delete mode 100644 xtext/Dockerfile delete mode 100644 xtext/static.xtext/Dockerfile diff --git a/README.md b/README.md index db52a92..a097c9c 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,41 @@ See the readme file in the respective tool directory for instructions on running [Xtext (MDENet)](services/com.mde-network.ep.toolfunctions.xtextfunction/README.md) +## Building Tool Docker Images + +All tool services are built from a single root-level `Dockerfile` using Docker's multi-stage build. A shared Maven build stage compiles all tool modules once; subsequent stages copy only the artifacts required for each individual tool. + +**The build context must be the repository root.** + +To build a specific tool service image, target the appropriate stage: + +```bash +# EMF tool +docker build --target toolservice-emf -t emf-tool . + +# Emfatic tool +docker build --target toolservice-emfatic -t emfatic-tool . + +# Eclipse OCL tool +docker build --target toolservice-ocl -t ocl-tool . + +# Conversion (Epsilon) tool +docker build --target toolservice-conversion -t conversion-tool . + +# Xtext tool +docker build --target toolservice-xtext -t xtext-tool . +``` + +The Xtext stage accepts optional build arguments for CORS and editor server configuration: + +```bash +docker build --target toolservice-xtext \ + --build-arg TRUSTED_ORIGINS="https://example.com" \ + --build-arg ES_ADDRESS="http://localhost:10001" \ + --build-arg ES_DEPLOY_ADDRESS="http://localhost:8080" \ + -t xtext-tool . +``` + diff --git a/static.conversion/Dockerfile b/static.conversion/Dockerfile deleted file mode 100644 index b09421c..0000000 --- a/static.conversion/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM maven:3.8.5-openjdk-17 AS toolfunctions - -#Copy epsilon toolfunction source and its dependencies -COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -COPY services/com.mde-network.ep.toolfunctions.emf /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf -COPY services/com.mde-network.ep.toolfunctions.epsilon /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.epsilon -COPY services/com.mde-network.ep.toolfunctions.epsilonfunction /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.epsilonfunction -COPY services/pom.xml /usr/src/toolfunctions/ - -WORKDIR /usr/src/toolfunctions - -RUN mvn clean install -Pepsilon - -# Get runtime dependencies -RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - -WORKDIR /usr/src/toolfunctions - - - -FROM node:19-bullseye AS toolstaticbuild - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY static.conversion/package*.json ./ - -COPY static.conversion . - -RUN npm install; npm run build; chmod -R 755 dist/ - - - - -FROM nginx:1.24.0-bullseye AS toolservice - -# Needed to avoid prompts blocking the build process -ENV DEBIAN_FRONTEND=noninteractive - -# Needed for Cloud Build -ENV PORT=80 - -# Install Python -RUN apt-get update \ - && apt-get install -y python3-minimal maven tini netcat \ - && rm -rf /var/lib/apt/lists/* - -# Copy tool sources -COPY services/epsilon /toolservice - -# Copy additional built tool and sources -COPY --from=toolfunctions /root/.m2 /root/.m2 -COPY --from=toolfunctions /usr/src/toolfunctions /toolservice-add - -# Copy files for webserver -COPY static.conversion/nginx.conf.template /etc/nginx.conf.template - -RUN rm -r /usr/share/nginx/html/* - -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist /usr/share/nginx/html - -WORKDIR /toolservice - -# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p -# is not a practical solution for ensuring all dependencies are available. -# -# We use https://github.com/qaware/go-offline-maven-plugin instead. -RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies - -# Copy start script and make it executable -ADD static.conversion/start.sh / -RUN chmod +x /start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] \ No newline at end of file diff --git a/static.emf/Dockerfile b/static.emf/Dockerfile deleted file mode 100644 index 89d4c5b..0000000 --- a/static.emf/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM maven:3.8.5-openjdk-17 AS toolfunctions - -#Copy emf toolfunction source and its dependencies -COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -COPY services/com.mde-network.ep.toolfunctions.emf /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf -COPY services/com.mde-network.ep.toolfunctions.emffunction /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emffunction -COPY services/pom.xml /usr/src/toolfunctions/ - -WORKDIR /usr/src/toolfunctions - -RUN mvn clean install -Pemf - -# Get runtime dependencies -RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - -WORKDIR /usr/src/toolfunctions - - - -FROM node:19-bullseye AS toolstaticbuild - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY static.emf/package*.json ./ - -COPY static.emf . - -RUN npm install; npm run build; chmod -R 755 dist/ - - - -FROM nginx:1.24.0-bullseye AS toolservice - -# Needed to avoid prompts blocking the build process -ENV DEBIAN_FRONTEND=noninteractive - -# Needed for Cloud Build -ENV PORT=80 - -# Install Python -RUN apt-get update \ - && apt-get install -y python3-minimal maven tini netcat \ - && rm -rf /var/lib/apt/lists/* - -# Copy built tool and sources -COPY --from=toolfunctions /root/.m2 /root/.m2 -COPY --from=toolfunctions /usr/src/toolfunctions /toolservice - -# Copy files for webserver -COPY static.emf/nginx.conf.template /etc/nginx.conf.template - -RUN rm -r /usr/share/nginx/html/* -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist /usr/share/nginx/html - -WORKDIR /toolservice - - -# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p -# is not a practical solution for ensuring all dependencies are available. -# -# We use https://github.com/qaware/go-offline-maven-plugin instead. -#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies - -# Copy start script and make it executable -ADD static.emf/start.sh / -RUN chmod +x /start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] \ No newline at end of file diff --git a/static.emfatic/Dockerfile b/static.emfatic/Dockerfile deleted file mode 100644 index 2b1f088..0000000 --- a/static.emfatic/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM maven:3.8.5-openjdk-17 AS toolfunctions - -#Copy emfatic toolfunction source and its dependencies -COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -COPY services/com.mde-network.ep.toolfunctions.emf /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf -COPY services/com.mde-network.ep.toolfunctions.emfatic /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emfatic -COPY services/com.mde-network.ep.toolfunctions.emfaticfunction /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emfaticfunction -COPY services/pom.xml /usr/src/toolfunctions/ - -WORKDIR /usr/src/toolfunctions - -RUN mvn clean install -Pemfatic - -# Get runtime dependencies -RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - -WORKDIR /usr/src/toolfunctions - - - -FROM node:19-bullseye AS toolstaticbuild - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY static.emfatic/package*.json ./ - -COPY static.emfatic . - -RUN npm install; npm run build; chmod -R 755 dist/ - - - -FROM nginx:1.24.0-bullseye AS toolservice - -# Needed to avoid prompts blocking the build process -ENV DEBIAN_FRONTEND=noninteractive - -# Needed for Cloud Build -ENV PORT=80 - -# Install Python -RUN apt-get update \ - && apt-get install -y python3-minimal maven tini netcat \ - && rm -rf /var/lib/apt/lists/* - -# Copy built tool and sources -COPY --from=toolfunctions /root/.m2 /root/.m2 -COPY --from=toolfunctions /usr/src/toolfunctions /toolservice - -# Copy files for webserver -COPY static.emfatic/nginx.conf.template /etc/nginx.conf.template - -RUN rm -r /usr/share/nginx/html/* -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist /usr/share/nginx/html - -WORKDIR /toolservice - - -# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p -# is not a practical solution for ensuring all dependencies are available. -# -# We use https://github.com/qaware/go-offline-maven-plugin instead. -#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies - -# Copy start script and make it executable -ADD static.emfatic/start.sh / -RUN chmod +x /start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] \ No newline at end of file diff --git a/static.ocl/Dockerfile b/static.ocl/Dockerfile deleted file mode 100644 index 095f4d6..0000000 --- a/static.ocl/Dockerfile +++ /dev/null @@ -1,74 +0,0 @@ -# syntax=docker/dockerfile:1 - -FROM maven:3.8.5-openjdk-17 AS toolfunctions - -#Copy ocl toolfunction source and its dependencies -COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -COPY services/com.mde-network.ep.toolfunctions.eclipseocl /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.eclipseocl -COPY services/com.mde-network.ep.toolfunctions.eclipseoclfunction /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.eclipseoclfunction -COPY services/pom.xml /usr/src/toolfunctions/ - -WORKDIR /usr/src/toolfunctions - -RUN mvn clean install -Pocl - -# Get runtime dependencies -RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - -WORKDIR /usr/src/toolfunctions - - - - -FROM node:19-bullseye AS toolstaticbuild - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY static.ocl/package*.json ./ - -COPY static.ocl . - -RUN npm install; npm run build; chmod -R 755 dist/ - - - -FROM nginx:1.24.0-bullseye AS toolservice - -# Needed to avoid prompts blocking the build process -ENV DEBIAN_FRONTEND=noninteractive - -# Needed for Cloud Build -ENV PORT=80 - -# Install Python -RUN apt-get update \ - && apt-get install -y python3-minimal openjdk-17-jdk maven tini netcat \ - && rm -rf /var/lib/apt/lists/* - -# Copy built tool and sources -COPY --from=toolfunctions /root/.m2 /root/.m2 -COPY --from=toolfunctions /usr/src/toolfunctions /toolservice - -# Copy files for webserver -COPY static.ocl/nginx.conf.template /etc/nginx.conf.template - -RUN rm -r /usr/share/nginx/html/* -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist /usr/share/nginx/html - -WORKDIR /toolservice - - -# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p -# is not a practical solution for ensuring all dependencies are available. -# -# We use https://github.com/qaware/go-offline-maven-plugin instead. -#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies - -# Copy start script and make it executable -ADD static.ocl/start.sh / -RUN chmod +x /start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] diff --git a/xtext/Dockerfile b/xtext/Dockerfile deleted file mode 100644 index ce93ca6..0000000 --- a/xtext/Dockerfile +++ /dev/null @@ -1,123 +0,0 @@ -# syntax=docker/dockerfile:1 - - -FROM node:19-bullseye AS toolstaticbuild - -# comma delimited whitelist of base URLs (with no trailing slash) for CORS aware endpoints -ARG TRUSTED_ORIGINS - -RUN apt-get update && apt-get install -y --no-install-recommends zip - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY xtext/static.xtext/package*.json ./ - -COPY xtext/static.xtext . - -RUN npm install; npm run build; chmod -R 755 dist/ - -# CORS configuration for webapp -COPY xtext/acemodebundler/web.xml /usr/src/mdenet-tool/dist/WEB-INF/web.xml - -RUN sed -i "s|http://127.0.0.1:8080|$TRUSTED_ORIGINS|g" /usr/src/mdenet-tool/dist/WEB-INF/web.xml - -RUN cd dist && zip -r ROOT.war . - - - - -FROM maven:3.6.3-openjdk-17 AS toolfunctions - -#Copy ocl toolfunction source and its dependencies -COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -COPY services/com.mde-network.ep.toolfunctions.emf /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.emf -COPY services/com.mde-network.ep.toolfunctions.xtext /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.xtext -COPY services/com.mde-network.ep.toolfunctions.xtextfunction /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.xtextfunction -COPY services/pom.xml /usr/src/toolfunctions/ - -WORKDIR /usr/src/toolfunctions - -RUN mvn clean install -Pxtext - -# Get runtime dependencies -RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - - -FROM tomcat:9.0.76-jdk17-temurin - -# See https://github.com/mdenet/educationplatform-docker/blob/main/README.md#environment-variables -ARG ES_ADDRESS -ARG ES_DEPLOY_ADDRESS - -# toolservice main endpoint port -ENV TS_PORT=9000 -# editor server internal port -ENV ES_PORT=10001 - -ENV INSTALL_DIR=/usr/local - -# Paths for editor builds -ENV ES_DIR=/editorserver -ENV ES_BUILD_LOCATION=${ES_DIR}/build -ENV ES_UPLOAD_LOCATION=${ES_DIR}/uploads -ENV ES_DEPLOY_FILE_LOCATION=${CATALINA_HOME}/webapps - -# The release of node to install -ENV NODE_VERSION=19.9.0 - -RUN apt-get update && apt-get install -y --no-install-recommends unzip zip xz-utils maven cron psmisc - -# Install node (detect architecture for arm64/x64 compatibility) -WORKDIR $INSTALL_DIR -RUN ARCH=$(dpkg --print-architecture) \ - && if [ "$ARCH" = "arm64" ] || [ "$ARCH" = "aarch64" ]; then NODE_ARCH="linux-arm64"; else NODE_ARCH="linux-x64"; fi \ - && NODE_RELEASE="node-v${NODE_VERSION}-${NODE_ARCH}" \ - && echo "Installing ${NODE_RELEASE}" \ - && curl --output ${NODE_RELEASE}.tar.xz https://nodejs.org/download/release/v${NODE_VERSION}/${NODE_RELEASE}.tar.xz \ - && tar -xf ${NODE_RELEASE}.tar.xz \ - && ln -s ${INSTALL_DIR}/${NODE_RELEASE} ${INSTALL_DIR}/node -ENV PATH="$INSTALL_DIR/node/bin:${PATH}" - - -WORKDIR /usr/src/toolfunctions - -# Copy built tool and sources -COPY --from=toolfunctions /root/.m2 /root/.m2 -COPY --from=toolfunctions /usr/src/toolfunctions /toolservice - -COPY xtext/acemodebundler /acemodebundler -COPY xtext/editorserver ${ES_DIR} - -WORKDIR /acemodebundler - -RUN npm ci - -WORKDIR ${ES_DIR} - -RUN npm ci --omit=dev - -EXPOSE ${ES_PORT} -EXPOSE ${TS_PORT} -#8080 is the default tomcat public port -EXPOSE 8080 - -COPY xtext/start.sh ${ES_DIR}/start.sh -COPY xtext/cron-setup.sh ${ES_DIR}/cron-setup.sh - - -RUN chmod +x ${ES_DIR}/start.sh -RUN chmod +x ${ES_DIR}/cron-setup.sh - -# deploy tool static files -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist/ROOT.war ${ES_DEPLOY_FILE_LOCATION}/ROOT.war - -# Cron time for scheduled stop -ENV XTEXT_ES_STOP_CRON_TIME="* 4 * * *" - -# setup cron job to periodically stop the server -RUN ./cron-setup.sh - -ENTRYPOINT [ "/bin/bash", "start.sh" ] diff --git a/xtext/static.xtext/Dockerfile b/xtext/static.xtext/Dockerfile deleted file mode 100644 index ae480cb..0000000 --- a/xtext/static.xtext/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# syntax=docker/dockerfile:1 - -# FROM maven:3.8.5-openjdk-17 AS toolfunctions - -# Copy xtext toolfunction source and its dependencies -# COPY services/com.mde-network.ep.toolfunctions.core /usr/src/toolfunctions/com.mde-network.ep.toolfunctions.core -# ... TODO -# COPY services/pom.xml /usr/src/toolfunctions/ - -# WORKDIR /usr/src/toolfunctions - -# RUN mvn clean install -Pxtext - -# # Get runtime dependencies -# RUN mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=com.google.cloud.functions:function-maven-plugin:0.9.5 && mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.0:get -Dartifact=org.apache.maven.plugins:maven-deploy-plugin:2.7 - -# WORKDIR /usr/src/toolfunctions - - - - -FROM node:19-bullseye AS toolstaticbuild - -WORKDIR /usr/src/mdenet-tool - -# Install app dependencies -# A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY static.xtext/package*.json ./ - -COPY static.xtext . - -RUN npm install; npm run build; chmod -R 755 dist/ - - - -FROM nginx:1.24.0-bullseye AS toolservice - -# Needed to avoid prompts blocking the build process -ENV DEBIAN_FRONTEND=noninteractive - -# Needed for Cloud Build -ENV PORT=80 - -# Install Python -RUN apt-get update \ - && apt-get install -y python3-minimal openjdk-17-jdk maven tini netcat \ - && rm -rf /var/lib/apt/lists/* - -# # Copy built tool and sources -# COPY --from=toolfunctions /root/.m2 /root/.m2 -# COPY --from=toolfunctions /usr/src/toolfunctions /toolservice - -# Copy files for webserver -COPY static.xtext/nginx.conf.template /etc/nginx.conf.template - -RUN rm -r /usr/share/nginx/html/* -COPY --from=toolstaticbuild /usr/src/mdenet-tool/dist /usr/share/nginx/html - -WORKDIR /toolservice - - -# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p -# is not a practical solution for ensuring all dependencies are available. -# -# We use https://github.com/qaware/go-offline-maven-plugin instead. -#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies - -# Copy start script and make it executable -ADD static.xtext/start.sh / -RUN chmod +x /start.sh - -ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] From 3d304e78df54693317eaf54e04ac9cbc6e9d6ecd Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Wed, 1 Apr 2026 11:15:06 +0100 Subject: [PATCH 05/11] Keep mention of offline dependency management To be considered later, whether this needs to be consistently applied across tools... --- Dockerfile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Dockerfile b/Dockerfile index 5c80105..5dde361 100644 --- a/Dockerfile +++ b/Dockerfile @@ -136,6 +136,13 @@ COPY --from=staticbuild-emf /usr/src/mdenet-tool/dist /usr/share/nginx/html WORKDIR /toolservice +# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p +# is not a practical solution for ensuring all dependencies are available. +# +# We use https://github.com/qaware/go-offline-maven-plugin instead. +# TODO: This was commented out in the original Docker file, but is active in some of the other tools. Need to understand which is correct. +#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies + # Copy start script and make it executable ADD static.emf/start.sh / RUN chmod +x /start.sh @@ -171,6 +178,13 @@ COPY --from=staticbuild-emfatic /usr/src/mdenet-tool/dist /usr/share/nginx/html WORKDIR /toolservice +# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p +# is not a practical solution for ensuring all dependencies are available. +# +# We use https://github.com/qaware/go-offline-maven-plugin instead. +# TODO: This was commented out in the original Docker file, but is active in some of the other tools. Need to understand which is correct. +#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies + ADD static.emfatic/start.sh / RUN chmod +x /start.sh @@ -204,6 +218,13 @@ COPY --from=staticbuild-ocl /usr/src/mdenet-tool/dist /usr/share/nginx/html WORKDIR /toolservice +# Due to https://issues.apache.org/jira/browse/MDEP-568, m-dependency-p +# is not a practical solution for ensuring all dependencies are available. +# +# We use https://github.com/qaware/go-offline-maven-plugin instead. +# TODO: This was commented out in the original Docker file, but is active in some of the other tools. Need to understand which is correct. +#RUN mvn -B de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies + ADD static.ocl/start.sh / RUN chmod +x /start.sh From ea8a7472be5c88a62b0bf9bd23ba59f29d838fb9 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Wed, 1 Apr 2026 11:19:19 +0100 Subject: [PATCH 06/11] Update Xtext docker-compose for consistency Not sure this is actually used anywhere, but at least this way it's consistent with what we do in the main repo --- xtext/docker-compose.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xtext/docker-compose.yml b/xtext/docker-compose.yml index 3c163d9..48feedf 100644 --- a/xtext/docker-compose.yml +++ b/xtext/docker-compose.yml @@ -3,10 +3,18 @@ services: mdenet-tool-xtext: image: mdenet-tool-xtext:latest ports: + - 8074:8080 - 10001:10001 - - 9001:8080 - 9000:9000 - + environment: + - TRUSTED_ORIGINS + - ES_DEPLOY_ADDRESS + - ES_ADDRESS build: context: .. - dockerfile: xtext/Dockerfile + dockerfile: Dockerfile + target: toolservice-xtext + args: + - TRUSTED_ORIGINS=$TRUSTED_ORIGINS + - ES_ADDRESS=$ES_ADDRESS + - ES_DEPLOY_ADDRESS=$ES_DEPLOY_ADDRESS From aa8dbc99b298e5100b99e7c5f68f6922536ebcdc Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Thu, 2 Apr 2026 11:23:17 +0100 Subject: [PATCH 07/11] Remove cached package index from Docker layer after use Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5dde361..a87f4f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -89,7 +89,7 @@ FROM node:19-bullseye AS staticbuild-xtext ARG TRUSTED_ORIGINS -RUN apt-get update && apt-get install -y --no-install-recommends zip +RUN apt-get update && apt-get install -y --no-install-recommends zip && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/mdenet-tool From 4c58bc119e445d5601a6cdf10483db52a51a8dc6 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Thu, 2 Apr 2026 18:56:18 +0100 Subject: [PATCH 08/11] Improved NPM caching and error reporting --- Dockerfile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index a87f4f6..5585404 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,9 +38,11 @@ FROM node:19-bullseye AS staticbuild-emf WORKDIR /usr/src/mdenet-tool COPY static.emf/package*.json ./ -COPY static.emf . +RUN npm ci -RUN npm install; npm run build; chmod -R 755 dist/ +COPY static.emf . +RUN npm run build \ + && chmod -R 755 dist/ # --------------------------------------------------------------------------- @@ -51,9 +53,11 @@ FROM node:19-bullseye AS staticbuild-emfatic WORKDIR /usr/src/mdenet-tool COPY static.emfatic/package*.json ./ -COPY static.emfatic . +RUN npm ci -RUN npm install; npm run build; chmod -R 755 dist/ +COPY static.emfatic . +RUN npm run build \ + && chmod -R 755 dist/ # --------------------------------------------------------------------------- @@ -64,9 +68,12 @@ FROM node:19-bullseye AS staticbuild-ocl WORKDIR /usr/src/mdenet-tool COPY static.ocl/package*.json ./ +RUN npm ci + COPY static.ocl . -RUN npm install; npm run build; chmod -R 755 dist/ +RUN npm run build \ + && chmod -R 755 dist/ # --------------------------------------------------------------------------- @@ -77,9 +84,12 @@ FROM node:19-bullseye AS staticbuild-conversion WORKDIR /usr/src/mdenet-tool COPY static.conversion/package*.json ./ +RUN npm ci + COPY static.conversion . -RUN npm install; npm run build; chmod -R 755 dist/ +RUN npm run build \ + && chmod -R 755 dist/ # --------------------------------------------------------------------------- @@ -94,9 +104,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends zip && rm -rf / WORKDIR /usr/src/mdenet-tool COPY xtext/static.xtext/package*.json ./ -COPY xtext/static.xtext . +RUN npm ci -RUN npm install; npm run build; chmod -R 755 dist/ +COPY xtext/static.xtext . +RUN npm run build \ + && chmod -R 755 dist/ # CORS configuration for webapp COPY xtext/acemodebundler/web.xml /usr/src/mdenet-tool/dist/WEB-INF/web.xml From be68a33c4fc5fd540c6d618844c854e00e885f17 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Thu, 2 Apr 2026 18:59:11 +0100 Subject: [PATCH 09/11] Clean up APT lists for leaner layers --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5585404..921166d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -311,7 +311,9 @@ ENV ES_DEPLOY_FILE_LOCATION=${CATALINA_HOME}/webapps # The release of node to install ENV NODE_VERSION=19.9.0 -RUN apt-get update && apt-get install -y --no-install-recommends unzip zip xz-utils maven cron psmisc +RUN apt-get update \ + && apt-get install -y --no-install-recommends unzip zip xz-utils maven cron psmisc \ + && rm -rf /var/lib/apt/lists/* # Install node (detect architecture for arm64/x64 compatibility) WORKDIR $INSTALL_DIR From 77274232e714b558c3d314163e684b68042a1f86 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Thu, 2 Apr 2026 19:09:07 +0100 Subject: [PATCH 10/11] Action versions updated --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/reports.yml | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d227fca..ac4b915 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,12 +18,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Setup node 18 - uses: actions/setup-node@v4 + - name: Setup node 19 + uses: actions/setup-node@v6 with: - node-version: 18 + node-version: 19 - name: Install node dependencies working-directory: ./xtext/editorserver @@ -34,7 +34,7 @@ jobs: run: npm run lint - name: Upload Lint Results - Xtext Editor Server - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ !cancelled() }} # run this step even if previous step failed with: name: lint-results-editor-server @@ -48,21 +48,21 @@ jobs: run: npm run coverage - name: Upload Test Results - Xtext Editor Server - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: success() || failure() && steps.run-unit-tests.outcome == 'success' with: name: test-results-editor-server path: '**/reports/TESTS*.xml' - name: Setup .NET Core - for coverage report # Required to execute ReportGenerator - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 if: success() || failure() && steps.run-unit-tests.outcome == 'success' with: dotnet-version: 8.x dotnet-quality: 'ga' - name: Create coverage md report - uses: danielpalme/ReportGenerator-GitHub-Action@5.5.0 + uses: danielpalme/ReportGenerator-GitHub-Action@5.5.4 if: success() || failure() && steps.run-unit-tests.outcome == 'success' with: reports: '**/reports/coverage/*.xml' @@ -70,7 +70,7 @@ jobs: reporttypes: MarkdownSummaryGithub - name: Upload Coverage Report - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: ${{ !cancelled() }} # run this step even if previous step failed with: name: coverage-results-editor-server diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index ff70326..941200b 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -17,7 +17,7 @@ jobs: - name: Create lint report - Xtext Editor Server id: build-xtext-es if: success() || failure() - uses: dorny/test-reporter@v2 + uses: dorny/test-reporter@v3 with: name: Lint Results - Xtext Editor Server artifact: lint-results-editor-server @@ -26,7 +26,7 @@ jobs: fail-on-error: true - name: Create test report - uses: dorny/test-reporter@v2 + uses: dorny/test-reporter@v3 if: success() || failure() with: name: Unit Test Results @@ -36,7 +36,7 @@ jobs: fail-on-error: true - name: Download Coverage Files - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v8 if: success() || failure() with: name: coverage-results-editor-server From f7079c139e9e04495d3b2f11ed9de23e1917b7a0 Mon Sep 17 00:00:00 2001 From: Steffen Zschaler Date: Thu, 30 Apr 2026 17:46:08 +0100 Subject: [PATCH 11/11] Ensure Xtext env variables are correctly passed into dockerfile --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 921166d..6b80d8f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -291,15 +291,15 @@ ENTRYPOINT ["/usr/bin/tini", "--", "/start.sh"] # --------------------------------------------------------------------------- FROM tomcat:9.0.76-jdk17-temurin AS toolservice-xtext -# See https://github.com/mdenet/educationplatform-docker/blob/main/README.md#environment-variables -ARG ES_ADDRESS -ARG ES_DEPLOY_ADDRESS - # toolservice main endpoint port ENV TS_PORT=9000 # editor server internal port ENV ES_PORT=10001 +# See https://github.com/mdenet/educationplatform-docker/blob/main/README.md#environment-variables +ENV ES_ADDRESS="http://127.0.0.1:${ES_PORT}" +ENV ES_DEPLOY_ADDRESS="http://127.0.0.1:8074" + ENV INSTALL_DIR=/usr/local # Paths for editor builds