-
Notifications
You must be signed in to change notification settings - Fork 28
Dockerize ECD API Service #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@Suraj-kumar00 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 3 seconds before requesting another review. β How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. π¦ How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. π Files selected for processing (4)
WalkthroughA multi-stage Dockerfile is added to build and run a Java application using Maven and Eclipse Temurin JDK/JRE 17. The Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Docker Build (Stage 1)
participant Docker Build (Stage 2)
participant Java App
Developer->>Docker Build (Stage 1): Build image with Maven & JDK 17
Docker Build (Stage 1)->>Docker Build (Stage 1): Copy source, cache dependencies, package app (skip tests)
Docker Build (Stage 1)->>Docker Build (Stage 2): Copy WAR file to runtime image
Docker Build (Stage 2)->>Java App: Run app with JRE 17 using java -jar app.war
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π§Ή Nitpick comments (2)
Dockerfile (2)
2-10
: Optimize Maven dependency caching and build layers.The current
COPY . .
will bust the cache for every source change, re-running the fullmvn clean package
. To speed up iterative builds, separate dependency resolution and source compilation:- COPY . . - RUN --mount=type=cache,target=/root/.m2 \ - mvn clean package -DENV_VAR=ci -DskipTests -Dgit.skip=true + COPY pom.xml mvnw ./ + COPY .mvn .mvn + RUN --mount=type=cache,target=/root/.m2 \ + mvn dependency:go-offline -B + COPY src ./src + RUN --mount=type=cache,target=/root/.m2 \ + mvn clean package -DENV_VAR=ci -DskipTests -Dgit.skip=trueAdditionally, introduce a
.dockerignore
to excludetarget/
,.git/
, and other transient files.
13-22
: Harden the runtime image and improve observability.
- Create and switch to a non-root user for better security (
USER app
).- Add a
HEALTHCHECK
to verify service readiness:HEALTHCHECK --interval=30s --timeout=5s \ CMD curl -f http://localhost:8080/actuator/health || exit 1
- Consider a slimmer base (e.g.,
eclipse-temurin:17-jre-jammy
or a distroless image) to reduce footprint.
|
π Description
JIRA ID:
This PR introduces Docker support for the ECD API service, enabling consistent and containerized builds.
This PR resolves issue PSMRI/AMRIT#59
β Type of Change
Summary by CodeRabbit