leizhiyuan opened a new pull request, #1471:
URL: https://github.com/apache/rocketmq-dashboard/pull/1471
## What is the purpose of the change
Fixes #1470.
Repeated local Studio deployments are slow because the backend is built in a
Docker build stage that cannot reuse the developer's host Maven repository.
When that layer is invalidated, Maven downloads the same dependencies again.
This change keeps Maven containerized while mounting the host Maven cache,
then packages the resulting JAR into the runtime image.
## Brief changelog
- Build the server with a temporary Maven container from `deploy/deploy.sh`.
- Mount `MAVEN_CACHE_DIR` (default: `~/.m2`) and set `maven.repo.local` to
its `repository` directory.
- Reuse `settings.xml` from the mounted Maven directory when present.
- Run the build container with the host UID/GID to avoid root-owned build
artifacts.
- Add a `runtime-prebuilt` Dockerfile target for packaging the generated JAR.
- Preserve the default Dockerfile build target for CI and Docker Compose
compatibility.
- Document `MAVEN_CACHE_DIR` and `MAVEN_IMAGE` overrides.
## Verifying this change
- `bash -n deploy/deploy.sh`
- `git diff --check`
- Ran the Maven container build using an existing host `~/.m2` cache:
- build succeeded;
- no dependency downloads were reported;
- Maven build completed in 18.812 seconds.
- Built `server/Dockerfile` with `--target runtime-prebuilt`:
- image build succeeded;
- the Maven build stage was not executed;
- `/app/app.jar` exists in the resulting image;
- image entrypoint remains `java -jar app.jar`.
- [x] A GitHub issue is filed for this change.
- [x] The pull request addresses one issue.
- [x] The commit has a meaningful subject and Signed-off-by line.
- [x] The change is documented.
- [x] Full deployment was not run because it requires configured remote
SSH/Podman infrastructure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]