Skip to content
Open
Changes from all 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
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM nginx:1.23.0

# Update apt and install required packages
RUN apt-get update && apt-get upgrade -y

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

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

Following Docker best practices and for consistency with lines 16-17, consider adding apt-get clean and rm -rf /var/lib/apt/lists/* at the end of this RUN command to reduce the image layer size. This helps minimize the final Docker image size by removing the apt package cache after upgrades.

Suggested change
RUN apt-get update && apt-get upgrade -y
RUN apt-get update && apt-get upgrade -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Copilot uses AI. Check for mistakes.

RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get install -y nodejs
# Install Node.js using NodeSource - run apt-get update after setup script
# The setup script adds the NodeSource repository but apt cache may be stale
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

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

The RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - line downloads and executes a remote script as root without any integrity verification, creating a supply chain risk if the NodeSource endpoint or its delivery path is compromised. An attacker who can tamper with that script (via DNS, CDN, or repository compromise) could inject arbitrary commands into your build and produce a malicious image. Prefer installing Node.js via signed distribution packages or ensure the script is pinned and verified via checksum or signature before execution.

Copilot uses AI. Check for mistakes.
&& apt-get update \
&& apt-get install -y nodejs

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

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

For consistency with the other package installation command (lines 13-17) and Docker best practices, consider adding apt-get clean and rm -rf /var/lib/apt/lists/* at the end of this RUN command to reduce the image layer size. This helps minimize the final Docker image size by removing the apt package cache.

Suggested change
&& apt-get install -y nodejs
&& apt-get install -y nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Copilot uses AI. Check for mistakes.

Comment on lines +6 to 11

Copilot AI Jan 30, 2026

Copy link

Choose a reason for hiding this comment

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

The apt-get update command here is redundant. The NodeSource setup script (setup_18.x) already runs apt-get update as part of its execution. This adds unnecessary time to the Docker build. Consider removing this line to optimize the build process.

Suggested change
# Install Node.js using NodeSource - run apt-get update after setup script
# The setup script adds the NodeSource repository but apt cache may be stale
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs
# Install Node.js using NodeSource
# The setup script adds the NodeSource repository and runs apt-get update
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs

Copilot uses AI. Check for mistakes.
RUN \
apt-get install -y \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 \
libxss1 libasound2 libxtst6 xauth xvfb g++ make
# Install dependencies for Cypress and build tools
RUN apt-get install -y \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 \
libxss1 libasound2 libxtst6 xauth xvfb g++ make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /src/build-your-own-radar
COPY package.json ./
Expand All @@ -17,7 +23,7 @@ RUN npm ci

COPY . ./

# Override parent node image's entrypoint script (/usr/local/bin/docker-entrypoint.sh),
# Override parent node image entrypoint script (/usr/local/bin/docker-entrypoint.sh),
# which tries to run CMD as a node command
ENTRYPOINT []
CMD ["./build_and_start_nginx.sh"]
Loading