Skip to content

Commit 08425ea

Browse files
authored
Merge the "release/v1.0.2" branch to the "main" branch
This merge brings release/v1.0.2 into main and includes both the Docker runtime extraction refactor and the 1.0.2 version bump. The runtime stage now uses amnoorbrar/runtime-node:v1.0.0-24.13.1 instead of a manually assembled scratch-based runtime, removing explicit runtime dependency copy steps from the Dockerfile. Package metadata is aligned by updating package.json and package-lock.json from version 1.0.1 to 1.0.2 while preserving the existing application startup flow.
2 parents 855ae4c + 852b410 commit 08425ea

3 files changed

Lines changed: 5 additions & 19 deletions

File tree

Dockerfile

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,12 @@ RUN npm ci --omit=dev
1313
# Finally, the rest of the application code is copied into the working directory. This includes all the source files needed to run the application.
1414
COPY . .
1515

16-
#The base image for runtime stage is scratch, which is an empty image. This means that only the files explicitly copied from the builder stage will be included in the final image.
17-
FROM scratch
18-
19-
# The necessary files and directories are copied from the builder stage to the runtime stage. The --chown=0:1000 flag sets the ownership of the files to user ID 1000 and group ID 1000, while the --chmod=550 flag sets the permissions to read and execute for the owner and group, and no permissions for others.
20-
COPY --from=builder --chown=0:1000 --chmod=550 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
21-
22-
# The necessary shared libraries for Node.js are also copied from the builder stage to the runtime stage. This includes the musl libc dynamic linker (ld-musl-*.so.1) and the standard C++ library (libstdc++.so.6) and the GCC support library (libgcc_s.so.1). These libraries are required for Node.js to run properly in the scratch image, which does not include any base libraries.
23-
COPY --from=builder --chown=0:1000 --chmod=550 /lib/ld-musl-*.so.1 /lib/
24-
COPY --from=builder --chown=0:1000 --chmod=550 /usr/lib/libstdc++.so.6 /usr/lib/
25-
COPY --from=builder --chown=0:1000 --chmod=550 /usr/lib/libgcc_s.so.1 /usr/lib/
26-
27-
# The Node.js binary itself is also copied from the builder stage to the runtime stage. This allows the application to run using the Node.js runtime in the scratch image.
28-
COPY --from=builder --chown=0:1000 --chmod=550 /usr/local/bin/node /usr/local/bin/node
16+
# The base image for the runtime stage is a custom image named amnoorbrar/runtime-node:v1.0.0-24.13.1. This image is based on a Node.js runtime environment.
17+
FROM amnoorbrar/runtime-node:v1.0.0-24.13.1
2918

3019
# Finally, the application files are copied from the builder stage to the runtime stage. This includes all the source files needed to run the application, and they are set with appropriate ownership and permissions for security and functionality.
3120
COPY --from=builder --chown=0:1000 --chmod=550 /application /application
3221

33-
# The USER instruction sets the user and group for running the application. In this case, it is set to user ID 1000 and group ID 1000, which is a common non-root user in many Linux distributions. This is a security best practice to avoid running applications as the root user.
34-
USER 1000:1000
35-
3622
# The working directory is set to /application, which is where the application code is located. This means that when the container starts, it will be in this directory, and any commands will be executed from this location.
3723
WORKDIR /application
3824

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "digital-clock",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "A sleek, blazing-fast digital clock with a built-in stopwatch — simple on the surface, thoughtfully engineered underneath.",
55
"keywords": [
66
"digital-clock", "digitalclock", "clock", "stopwatch",

0 commit comments

Comments
 (0)