-
Notifications
You must be signed in to change notification settings - Fork 46
BUGFIX/HCMPRE-0009: Adding dependency for docker #3008
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: master
Are you sure you want to change the base?
Changes from all commits
6374b44
faa3f62
7ddffeb
1b61cff
25a6273
a38c7f8
057ec66
fe45e43
2ac070b
85d606f
384ecf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,6 @@ on: | |
| - sandbox-ui | ||
| - microplan-ui | ||
| - console | ||
| - dashboard-ui | ||
| - payments-ui | ||
| - storybook-svg | ||
| - storybook | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ module.exports = { | |
| output: { | ||
| filename: "[name].bundle.js", | ||
| path: path.resolve(__dirname, "build"), | ||
| publicPath: "/dashboard-ui/", | ||
| publicPath: "/microplan-ui/", | ||
| }, | ||
|
Comment on lines
+34
to
35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPublic path change looks good; verify router/base href alignment Switching output.publicPath to "/microplan-ui/" aligns with nginx and Dockerfile. Ensure your SPA router basename (e.g., React Router) or the in public/index.html also reflects "/microplan-ui/" to avoid broken asset/routes. Run to find lingering "/dashboard-ui" references and check base href: 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Any legacy path refs in this app?
rg -nC2 -g 'health/micro-ui/web/health-dss/**' '/dashboard-ui\b' || echo "No legacy /dashboard-ui refs found under health-dss."
# Confirm webpack publicPath
rg -nP 'publicPath\s*:\s*["\']([^"\']+)["\']' health/micro-ui/web/health-dss/webpack.config.js
# Inspect base href in any index.html files
fd -a --strip-cwd-prefix index.html health/micro-ui/web/health-dss | xargs -r -I{} rg -nH -P '<base\s+href=["\']([^"\']+)["\']' "{}" || echo "No <base href> tags found."Length of output: 527 Let’s re-run with simpler commands to confirm both the webpack publicPath and any 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
# 1. Check webpack publicPath setting
grep -RIn "publicPath" health/micro-ui/web/health-dss/webpack.config.js || echo "publicPath not found in webpack.config.js"
# 2. Look for any <base href> in index.html files
grep -RIn "<base[^>]*href" health/micro-ui/web/health-dss || echo "No <base href> tags found"Length of output: 249 Align nginx.conf and HTML base href with the new publicPath We’ve confirmed that • health/micro-ui/web/health-dss/nginx.conf (line 10): try_files $uri $uri/ /dashboard-ui/index.html;Update to: try_files $uri $uri/ /microplan-ui/index.html;• No <base href="/microplan-ui/">• Ensure your SPA router (e.g., React Router’s 🤖 Prompt for AI Agents |
||
| optimization: { | ||
| splitChunks: { | ||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
WORK_DIR aligns; harden runtime image (non-root + healthcheck)
The new WORK_DIR (/var/web/microplan-ui) matches nginx root mapping. Strengthen security and operability by running as non-root and adding a basic healthcheck.
Apply:
ENV WORK_DIR=/var/web/microplan-ui RUN mkdir -p ${WORK_DIR} COPY --from=build /app/web/build ${WORK_DIR}/ COPY --from=build /app/web/health-dss/nginx.conf /etc/nginx/conf.d/default.conf +RUN chown -R nginx:nginx ${WORK_DIR} /var/cache/nginx /var/run +USER nginx +HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -q --spider http://127.0.0.1:80/microplan-ui/ || exit 1Additional note (outside this range): consider upgrading the build stage to an LTS base (Node 18/20) to avoid EOL risks:
Dockerfile
Confirm alignment across files:
🏁 Script executed:
Length of output: 511
🏁 Script executed:
Length of output: 207
Harden runtime image: run as non-root & add basic healthcheck
Alignment across Dockerfile, nginx.conf and webpack.config.js confirmed. To strengthen security and observability, consider this optional refactor in your final stage:
ENV WORK_DIR=/var/web/microplan-ui RUN mkdir -p ${WORK_DIR} COPY --from=build /app/web/build ${WORK_DIR}/ COPY --from=build /app/web/health-dss/nginx.conf /etc/nginx/conf.d/default.conf +RUN chown -R nginx:nginx ${WORK_DIR} /var/cache/nginx /var/run +USER nginx +HEALTHCHECK --interval=30s --timeout=3s --retries=3 \ + CMD wget -q --spider http://127.0.0.1:80/microplan-ui/ || exit 1Optional upgrade for build stage to avoid EOL risk:
FROM node:18-alpine AS build🧰 Tools
🪛 Checkov (3.2.334)
[LOW] 1-45: Ensure that HEALTHCHECK instructions have been added to container images
(CKV_DOCKER_2)
[LOW] 1-45: Ensure that a user for the container has been created
(CKV_DOCKER_3)
🤖 Prompt for AI Agents