-
Notifications
You must be signed in to change notification settings - Fork 32
Copy env variables to new docker properties for deploying in Linux/Docker #85
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
Conversation
Dockerize Admin API Application
|
Warning Rate limit exceeded@drtechie has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 54 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 (1)
""" WalkthroughA multi-stage Dockerfile for building and running a Java application was introduced. The Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant Docker
participant Maven
participant Java App
Developer->>Docker: Build Docker image
Docker->>Maven: Use Maven image to build app (clean package)
Maven-->>Docker: Output WAR file
Docker->>Java App: Copy WAR, set up runtime with JRE
Java App-->>Docker: Application starts with Docker-specific properties
Possibly related PRs
Suggested reviewers
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: 4
🧹 Nitpick comments (2)
src/main/environment/admin_docker.properties (1)
3-6: Document required environment variables.
Placeholders like${DATABASE_URL},${CALLCENTRE_SERVER_IP}, and${SWYMED_APIKEY}must be defined in the container. Consider documenting them in your README or providing sample.envfiles for local testing.Also applies to: 8-11
Dockerfile (1)
20-23: Add a HEALTHCHECK instruction.
AHEALTHCHECKhelps orchestration platforms verify container health:+HEALTHCHECK --interval=30s --timeout=5s CMD curl --fail http://localhost:8080/actuator/health || exit 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.gitignore(1 hunks)Dockerfile(1 hunks)pom.xml(1 hunks)src/main/environment/admin_ci.properties(1 hunks)src/main/environment/admin_docker.properties(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Analyze (java)
- GitHub Check: Build
- GitHub Check: Package-test
🔇 Additional comments (6)
src/main/environment/admin_ci.properties (1)
26-26: Trailing newline removal – no functional impact.
This change only adjusts file formatting by removing the trailing newline. There’s no effect on runtime behavior..gitignore (1)
18-19: Ignore.envfor environment-specific variables.
Adding this rule prevents local.envfiles from being committed, aligning with your Docker-based setup.pom.xml (1)
465-476: Add Spring Boot plugin for repackaging.
This plugin configuration (version 3.2.2) matches your parent Spring Boot version and enables creation of an executable archive for the Docker workflow.Dockerfile (3)
1-7: Multi-stage build setup – approved.
Using Maven 3.9.6 with Temurin 17 in the build stage is solid for reproducibility; copying the full context is correct.
9-11: Cache Maven dependencies and skip tests.
Mounting/root/.m2speeds up builds, but note tests are skipped here. Ensure your CI still runs the test suite.
13-17: Runtime stage base image selection.
Eclipse Temurin JRE 17 is appropriate for running the Spring Boot WAR.
| #ELK logging file name | ||
| logging.file.name=${ADMIN_API_LOGGING_FILE_NAME} | ||
|
|
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.
Missing logging.path property.
Your CI config includes a logging.path setting, but it’s absent here. Add it to keep log directory consistency:
+# log directory
+logging.path=${LOGGING_PATH}🤖 Prompt for AI Agents
In src/main/environment/admin_docker.properties around lines 17 to 19, the
logging configuration is missing the logging.path property, which is present in
the CI config. Add a logging.path property with the appropriate directory path
to ensure consistency in log file locations across environments.
| COPY --from=build /app/target/*.war app.war | ||
|
|
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.
🛠️ Refactor suggestion
Use explicit artifact name instead of wildcard.
Relying on *.war may catch unintended files. Specify the generated WAR to avoid ambiguity:
-COPY --from=build /app/target/*.war app.war
+COPY --from=build /app/target/${artifactId}-${version}.war app.warCommittable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In Dockerfile lines 18 to 19, replace the wildcard '*.war' in the COPY command
with the explicit name of the generated WAR file to avoid copying unintended
files. Identify the exact WAR filename produced in the build stage and use that
exact name in the COPY --from=build command.
|



📋 Description
JIRA ID: AMM-1625
Proposed Changes:
${}to ensure environment variables inside the system is used instead of injecting from Jenkins - used for Linux and Docker deployments✅ Type of Change
Summary by CodeRabbit