Skip to content

Optimize Docker image for a smaller and safer runtime - #67

Merged
yashdotdev13 merged 1 commit into
mainfrom
fix/8-optimize-docker-image
Nov 5, 2026
Merged

yashdotdev13 merged 1 commit into
mainfrom
fix/8-optimize-docker-image

Conversation

@yashdotdev13

Copy link
Copy Markdown
Owner

Summary

Improves the existing Docker image to reduce runtime image size, enhance security, and optimize the Docker build process without changing application behavior.

Changes Made

  • Implemented a multi-stage Docker build to separate build-time and runtime dependencies.
  • Optimized Maven dependency caching to improve build efficiency.
  • Used Eclipse Temurin JDK 21 for building and JRE 21 for the runtime stage.
  • Configured a dedicated non-root user (appuser) with explicit UID and GID.
  • Used COPY --chown to ensure appropriate file ownership in the runtime image.
  • Kept only the packaged application JAR in the final runtime image.
  • Retained curl for compatibility with the existing Docker Compose healthcheck.
  • Preserved existing ports, entrypoint, environment-driven configuration, and Compose topology.

Testing

  • Docker image builds successfully.
  • Verified the container runs as a non-root user.
  • Verified the application starts successfully through Docker Compose.
  • Confirmed the health endpoint returns UP.
  • Verified compatibility with the existing Docker Compose deployment.
  • Maven tests passed.

Related Issue

Closes #8

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T05:37:38.906815Z 80d7643 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@yashdotdev13
yashdotdev13 merged commit 569cce7 into main Nov 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Docker image for a smaller and safer runtime

1 participant