Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions health/micro-ui/web/health-dss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,23 @@ RUN node -e "console.log('Heap limit (MB):', v8.getHeapStatistics().heap_size_li
# Print a marker log (optional debug message)
RUN node -e "console.log('core only')"

# ---- FIX: Install main deps before health-dss ----
RUN yarn config set network-timeout 600000
RUN yarn install --ignore-scripts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Consolidate RUNs and pin install to lockfile; reassess use of --ignore-scripts

Good call installing root deps upfront. To reduce layers (DL3059) and improve determinism, consider consolidating and enforcing the lockfile. Also, verify that ignoring scripts doesn’t break builds if any package relies on install/postinstall/prepare scripts.

Apply within this range:

-# ---- FIX: Install main deps before health-dss ----
-RUN yarn config set network-timeout 600000
-RUN yarn install --ignore-scripts
+# ---- FIX: Install main deps before health-dss ----
+RUN yarn config set network-timeout 600000 \
+  && yarn install --frozen-lockfile --ignore-scripts

Additionally, outside this range (nit):
Dockerfile

# collapse these consecutive RUNs too
RUN chmod +x ./install-deps.sh && ./install-deps.sh

To validate that skipping lifecycle scripts is safe, run this repo-scoped check to list any install/postinstall/prepare scripts under web/:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json, os, sys
base = "health/micro-ui/web"
found = []
for root, _, files in os.walk(base):
    if "package.json" in files:
        p = os.path.join(root, "package.json")
        try:
            with open(p) as f:
                data = json.load(f)
            scripts = data.get("scripts", {})
            lifecycles = {k:v for k,v in scripts.items() if k in ("install","postinstall","prepare","preinstall")}
            if lifecycles:
                found.append((p, lifecycles))
        except Exception as e:
            print(f"WARN: could not parse {p}: {e}", file=sys.stderr)
if found:
    print("Lifecycle scripts detected that may be skipped by --ignore-scripts:")
    for p, lc in found:
        print(f"- {p}")
        for k,v in lc.items():
            print(f"    {k}: {v}")
else:
    print("No install/postinstall/prepare scripts found under web/")
PY

Length of output: 87


Consolidate RUNs, freeze lockfile, and confirm --ignore-scripts safety

No install/postinstall/prepare scripts were detected under health/micro-ui/web, so using --ignore-scripts is safe. To reduce image layers (DL3059) and ensure deterministic installs, you can consolidate the two RUNs and pin to your lockfile:

-# ---- FIX: Install main deps before health-dss ----
-RUN yarn config set network-timeout 600000
-RUN yarn install --ignore-scripts
+# ---- FIX: Install main deps before health-dss ----
+RUN yarn config set network-timeout 600000 \
+  && yarn install --frozen-lockfile --ignore-scripts

Nit (outside this range): collapse consecutive RUNs for your custom installer too:

# before
RUN chmod +x ./install-deps.sh
RUN ./install-deps.sh

# after
RUN chmod +x ./install-deps.sh && ./install-deps.sh
🧰 Tools
🪛 Hadolint (2.12.0)

[info] 22-22: Multiple consecutive RUN instructions. Consider consolidation.

(DL3059)


[info] 23-23: Multiple consecutive RUN instructions. Consider consolidation.

(DL3059)

🤖 Prompt for AI Agents
In health/micro-ui/web/health-dss/Dockerfile around lines 21 to 24, consolidate
the two RUNs into a single layer and make installs deterministic: combine the
yarn config set network-timeout and yarn install into one RUN and use the
lockfile (yarn install --frozen-lockfile) while retaining --ignore-scripts since
no install/postinstall/prepare scripts exist; also collapse any adjacent RUN
chmod +x and ./install-deps.sh into a single RUN with && as a follow-up
refinement.

# Move into health-dss and run install script
WORKDIR /app/web/health-dss
RUN chmod +x ./install-deps.sh
RUN ./install-deps.sh

# Return to main directory for install/build
# Return to main directory for build
WORKDIR /app/web

# Increase timeout before install (recommended for GitHub Actions)
RUN yarn config set network-timeout 600000

# Install dependencies
RUN yarn install

# Build the project
RUN yarn build:webpack
# ---- END FIX ----

FROM nginx:mainline-alpine
#FROM ghcr.io/egovernments/nginx:mainline-alpine
ENV WORK_DIR=/var/web/dashboard-ui
ENV WORK_DIR=/var/web/health-dss

RUN mkdir -p ${WORK_DIR}

Expand Down
3 changes: 2 additions & 1 deletion health/micro-ui/web/microplan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
},
"workspaces": [
"micro-ui-internals/packages/modules/microplan",
"micro-ui-internals/packages/modules/campaign-manager"
"micro-ui-internals/packages/modules/campaign-manager",
"micro-ui-internals/packages/modules/health-dss"
],
"homepage": "/microplan-ui",
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion health/micro-ui/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"workspaces": [
"micro-ui-internals/packages/modules/campaign-manager",
"micro-ui-internals/packages/modules/health-hrms",
"micro-ui-internals/packages/modules/pgr"
"micro-ui-internals/packages/modules/pgr",
"micro-ui-internals/packages/modules/health-dss"
],
"homepage": "/workbench-ui",
"dependencies": {
Expand All @@ -21,6 +22,7 @@
"@egovernments/digit-ui-module-hcmworkbench": "0.1.5",
"@egovernments/digit-ui-module-utilities": "1.0.12",
"@egovernments/digit-ui-module-campaign-manager": "0.4.0",
"@egovernments/digit-ui-module-health-dss": "0.0.1",
"@egovernments/digit-ui-module-health-pgr": "0.0.1",
"@egovernments/digit-ui-react-components": "1.8.24",
"@egovernments/digit-ui-svg-components": "1.0.21",
Expand Down