Consolidate tool Dockerfiles into a single multi-stage Dockerfile#111
Conversation
Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com> Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/b6ab5268-aa41-46be-9015-ddb9c14527a4
Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com> Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/e691f0eb-fb24-4c42-8fd9-8ba24d1e203f
There was a problem hiding this comment.
Pull request overview
This PR introduces a single root-level multi-stage Dockerfile that centralizes the Maven build for all tool services and then produces separate final images per tool by targeting different stages.
Changes:
- Adds a root
Dockerfilewith a sharedmavenbuilderstage that builds all tool modules with-Pall. - Adds per-tool frontend build stages (EMF, Emfatic, OCL, Conversion, Xtext) and per-tool final service stages.
- Updates service stages to copy only the Maven module folders needed for each tool (mirroring the original per-tool profile module sets).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Works in principle (tested on staging via mdenet/educationplatform-docker#83). Outstanding tasks before merge:
|
|
@copilot draft an update to the readme file and add it to this PR. |
…ions Agent-Logs-Url: https://github.com/mdenet/platformtools/sessions/7a50b9f8-7786-426b-9c41-57784673d87f Co-authored-by: szschaler <7057319+szschaler@users.noreply.github.com>
Done in 01cbd13. The README now has a "Building Tool Docker Images" section documenting the
Done in 01cbd13:
The Copilot reviewer suggestions (Node EOL, |
To be considered later, whether this needs to be consistently applied across tools...
…b.com/mdenet/platformtools into copilot/refactor-dockerfile-for-tools
Not sure this is actually used anywhere, but at least this way it's consistent with what we do in the main repo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
While doing this, might as well update the GitHub actions to move away from Node 20 Actions, which will deprecate in June 2026. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Works on staging... |
Each tool's Dockerfile independently ran a full Maven build, preventing Docker from caching shared build work across tools.
Changes
New root-level
Dockerfilewith the following stages:mavenbuilder– singlemvn clean install -Pallover the entireservices/directory; all tool service stages copy from this one cached layerstaticbuild-{emf,emfatic,ocl,conversion,xtext}– per-tool npm/webpack frontend buildstoolservice-{emf,emfatic,ocl,conversion,xtext}– final runtime images (nginxortomcat) pulling from the shared Maven stage and the tool-specific static build; each stage copies only the Maven module folders required for that toolRemoved old per-tool Dockerfiles (
static.emf/Dockerfile,static.emfatic/Dockerfile,static.ocl/Dockerfile,static.conversion/Dockerfile,xtext/Dockerfile,xtext/static.xtext/Dockerfile) — these are now superseded by the centralDockerfileUpdated
README.mdwith a new "Building Tool Docker Images" section documenting how to build each tool service using--targetUsage
Target the relevant stage when building, e.g.:
The central
Dockerfilerequires the build context to be the repository root. Updating the maindocker-composeto target these stages is a follow-up in a separate repository.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.