deploy-stack 0.17.2 → 0.17.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.17.2",
3
+ "version": "0.17.3",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"
@@ -1,3 +1,21 @@
1
+ # ==========================================
2
+ # Stage 1: Builder
3
+ # ==========================================
4
+ FROM node:22-alpine AS builder
5
+ WORKDIR /app
6
+
7
+ # Install all dependencies (including devDependencies)
8
+ COPY package*.json ./
9
+ RUN npm ci
10
+
11
+ # Copy source code and compile the SvelteKit application
12
+ COPY . .
13
+ # Inject the bypass flag so the adapter doesn't trigger inside the container!
14
+ RUN DEPLOY_STACK_BYPASS=true npm run build
15
+
16
+ # ==========================================
17
+ # Stage 2: Production (Zero-CVE)
18
+ # ==========================================
1
19
  FROM node:22-alpine
2
20
 
3
21
  # 1. DevSecOps: Patch underlying Alpine OS vulnerabilities
@@ -8,18 +26,17 @@ ENV NODE_ENV=production
8
26
  WORKDIR /app
9
27
 
10
28
  # 3. Copy manifests and install ONLY production dependencies
11
- COPY --chown=node:node package*.json ./
29
+ COPY --from=builder --chown=node:node /app/package*.json ./
12
30
  RUN npm ci --omit=dev && npm cache clean --force
13
31
 
14
- # 4. Copy the compiled SvelteKit server generated by adapter-node
15
- COPY --chown=node:node build/ ./build/
16
- COPY --chown=node:node package.json ./
32
+ # 4. Copy the compiled SvelteKit server from the builder stage
33
+ COPY --from=builder --chown=node:node /app/build/ ./build/
17
34
 
18
- # 5. DevSecOps: Remove NPM to eliminate Trivy vulnerabilities
35
+ # 5. DevSecOps: Nuke NPM completely to eliminate Trivy vulnerabilities
19
36
  RUN rm -rf /usr/local/lib/node_modules/npm /usr/local/bin/npm /usr/local/bin/npx
20
37
 
21
38
  USER node
22
39
  EXPOSE {{PORT}}
23
40
 
24
- # 6. Execute the raw Node server directly (Bypassing NPM)
41
+ # 6. Execute the raw Node server directly
25
42
  CMD ["node", "build/index.js"]