deploy-stack 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
FROM node:22-alpine
|
|
2
2
|
|
|
3
|
-
# 1.
|
|
3
|
+
# 1. DevSecOps: Patch underlying Alpine OS vulnerabilities and update global npm
|
|
4
|
+
RUN apk update && apk upgrade --no-cache && \
|
|
5
|
+
npm install -g npm@latest
|
|
6
|
+
|
|
7
|
+
# 2. Set production environment (optimizes Node and prevents dev dependencies)
|
|
4
8
|
ENV NODE_ENV=production
|
|
5
9
|
|
|
6
10
|
WORKDIR /app
|
|
7
11
|
|
|
8
|
-
#
|
|
12
|
+
# 3. Copy dependency manifests with non-root ownership
|
|
9
13
|
COPY --chown=node:node package*.json ./
|
|
10
14
|
RUN npm ci --omit=dev
|
|
11
15
|
|
|
12
|
-
#
|
|
16
|
+
# 4. Copy application code with non-root ownership
|
|
13
17
|
COPY --chown=node:node . .
|
|
14
18
|
|
|
15
|
-
#
|
|
19
|
+
# 5. DevSecOps best practice: do not run the container as root
|
|
16
20
|
USER node
|
|
17
21
|
|
|
18
22
|
EXPOSE {{PORT}}
|