-
Notifications
You must be signed in to change notification settings - Fork 48
Add Dockerfile and nginx configuration for koku-ui-onprem #4598
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
Add Dockerfile and nginx configuration for koku-ui-onprem #4598
Conversation
Reviewer's GuideAdds Docker support for the koku-ui-onprem React application by introducing a multi-stage Dockerfile using Node.js and RHEL Nginx, a templated nginx configuration for API proxying and SPA routing, and updates the package-lock.json for dependency alignment. Sequence diagram for API proxying via nginx in Docker containersequenceDiagram
participant User
participant Nginx
participant API_Backend
User->>Nginx: HTTP GET /api/resource
Nginx->>API_Backend: Proxy /api/resource to API_PROXY_URL
API_Backend-->>Nginx: Response
Nginx-->>User: Response
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @ELK4N4, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces comprehensive Docker support for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Hey there - I've reviewed your changes - here's some feedback:
- Consider pinning the Node and NGINX base images to specific digests or patch versions to ensure reproducible builds.
- For better container security, switch the NGINX process to run as a non-root user instead of root.
- Add a Docker HEALTHCHECK instruction to proactively verify that the SPA and API proxy are up after startup.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider pinning the Node and NGINX base images to specific digests or patch versions to ensure reproducible builds.
- For better container security, switch the NGINX process to run as a non-root user instead of root.
- Add a Docker HEALTHCHECK instruction to proactively verify that the SPA and API proxy are up after startup.
## Individual Comments
### Comment 1
<location> `PR_DESCRIPTION.md:41` </location>
<code_context>
+- `a5fd6c02a` - lint dockerfile
+- `8c6435aca` - remove exec from cmd
+- `fff94b2ed` - add proxy to /api with env config
+- `ee0eb2168` - optimzied dockerfile and support SPA routing
+- `a67797f9c` - init basic dockerfile and nginx
+
</code_context>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
aa5d79d to
fc388ba
Compare
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.
Code Review
This pull request introduces Docker support for the koku-ui-onprem application using a multi-stage build with Nginx, which is a great step towards modern deployment practices. The implementation is solid, using an official Red Hat Nginx image and a runtime configuration for the API proxy. My review includes a few suggestions to enhance security and robustness:
- Dockerfile: Run the Nginx process as a non-root user and ensure proper signal handling for graceful container shutdowns.
- Nginx Configuration: Add standard proxy headers to provide more context to the backend API and include common security headers to harden the application.
These changes will make the containerized application more secure and production-ready.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4598 +/- ##
=======================================
Coverage 88.82% 88.82%
=======================================
Files 480 480
Lines 9075 9075
Branches 2198 2197 -1
=======================================
Hits 8061 8061
+ Misses 954 953 -1
- Partials 60 61 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rawagner
left a comment
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.
Lets rename the file to Containerfile
acd1bd4 to
c8f0e77
Compare
Summary
This PR adds dockerfile for the
koku-ui-onpremapplication with nginx as the web server.Changes
Added
apps/koku-ui-onprem/Dockerfile: Multi-stage build that:Added
apps/koku-ui-onprem/nginx.conf.template: Nginx configuration that:/apirequests to a configurable backend URL viaAPI_PROXY_URLenvironment variableindex.html)Usage
Build and run the Docker container:
docker build -t koku-ui-onprem -f apps/koku-ui-onprem/Dockerfile . docker run -p 8080:8080 -e API_PROXY_URL=http://your-api-server:8000 koku-ui-onpremThe application will be available at
http://localhost:8080and API requests to/api/*will be proxied to the URL specified inAPI_PROXY_URL.Testing
API_PROXY_URLSummary by Sourcery
Provide containerized deployment of the koku-ui-onprem application with Docker and Nginx, supporting environment-based API proxying and SPA routing fallback
New Features: