deploy-stack 0.9.9 → 0.9.11
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,4 +1,4 @@
|
|
|
1
|
-
FROM python:3.12-
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
2
|
|
|
3
3
|
# Prevent Python from writing .pyc files and buffer stdout for cleaner logs
|
|
4
4
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
@@ -6,24 +6,26 @@ ENV PYTHONUNBUFFERED=1
|
|
|
6
6
|
|
|
7
7
|
WORKDIR /app
|
|
8
8
|
|
|
9
|
-
#
|
|
10
|
-
RUN
|
|
11
|
-
|
|
12
|
-
rm -rf /var/lib/apt/lists/*
|
|
9
|
+
# Create unprivileged user (Alpine syntax)
|
|
10
|
+
RUN addgroup -g 1001 appgroup && \
|
|
11
|
+
adduser -u 1001 -G appgroup -s /bin/sh -D appuser
|
|
13
12
|
|
|
14
|
-
#
|
|
15
|
-
RUN
|
|
16
|
-
|
|
13
|
+
# Install runtime libraries and temporary build tools
|
|
14
|
+
RUN apk update && \
|
|
15
|
+
apk add --no-cache libpq && \
|
|
16
|
+
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev
|
|
17
17
|
|
|
18
18
|
COPY requirements.txt .
|
|
19
19
|
|
|
20
|
-
# Upgrade
|
|
20
|
+
# Upgrade pip, install dependencies, clear caches, and NUKE package managers
|
|
21
21
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
|
22
|
+
pip install --no-cache-dir -r requirements.txt gunicorn && \
|
|
23
|
+
find / -type d -name "ensurepip" -exec rm -rf {} + || true && \
|
|
22
24
|
rm -rf /root/.cache/pip && \
|
|
23
|
-
|
|
25
|
+
pip uninstall -y setuptools wheel pip
|
|
24
26
|
|
|
25
|
-
#
|
|
26
|
-
RUN
|
|
27
|
+
# Remove the build tools to shrink the image and reduce attack surface
|
|
28
|
+
RUN apk del .build-deps
|
|
27
29
|
|
|
28
30
|
# Copy code with explicit ownership
|
|
29
31
|
COPY --chown=appuser:appgroup . .
|
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
FROM node:22-alpine AS builder
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
5
|
+
# Install native build tools required to compile C++ Node modules (like better-sqlite3)
|
|
6
|
+
RUN apk update && \
|
|
7
|
+
apk add --no-cache python3 make g++ sqlite-dev
|
|
8
|
+
|
|
5
9
|
COPY package.json package-lock.json* ./
|
|
6
10
|
RUN npm ci
|
|
7
11
|
|
|
12
|
+
# Explicitly install better-sqlite3 to satisfy Nuxt 4 / Nitro dynamic requirements
|
|
13
|
+
RUN npm install better-sqlite3
|
|
14
|
+
|
|
8
15
|
COPY . .
|
|
9
16
|
RUN npm run build
|
|
10
17
|
|
|
@@ -16,6 +23,17 @@ ENV NODE_ENV=production
|
|
|
16
23
|
ENV PORT={{PORT}}
|
|
17
24
|
ENV HOSTNAME="0.0.0.0"
|
|
18
25
|
|
|
26
|
+
# 1. Upgrade Alpine OS packages to clear OpenSSL/crypto CVEs
|
|
27
|
+
# 2. Vaporize Node package managers (npm, yarn, corepack) to clear ghost CVEs
|
|
28
|
+
RUN apk update && apk upgrade --no-cache && \
|
|
29
|
+
rm -rf /usr/local/lib/node_modules \
|
|
30
|
+
/usr/local/bin/npm \
|
|
31
|
+
/usr/local/bin/npx \
|
|
32
|
+
/usr/local/bin/yarn \
|
|
33
|
+
/usr/local/bin/yarnpkg \
|
|
34
|
+
/usr/local/bin/corepack \
|
|
35
|
+
/opt/yarn-*
|
|
36
|
+
|
|
19
37
|
# Create an unprivileged user and group
|
|
20
38
|
RUN addgroup -g 1001 -S nodejs && \
|
|
21
39
|
adduser -S nuxtjs -u 1001 -G nodejs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM python:3.12-
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
2
|
|
|
3
3
|
# Prevent Python from writing .pyc files and buffer stdout for cleaner logs
|
|
4
4
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
@@ -6,23 +6,26 @@ ENV PYTHONUNBUFFERED=1
|
|
|
6
6
|
|
|
7
7
|
WORKDIR /app
|
|
8
8
|
|
|
9
|
-
#
|
|
10
|
-
RUN
|
|
11
|
-
|
|
12
|
-
rm -rf /var/lib/apt/lists/*
|
|
9
|
+
# Create a non-root user for security compliance (Alpine syntax)
|
|
10
|
+
RUN addgroup -S appuser && \
|
|
11
|
+
adduser -S appuser -G appuser -D -s /bin/sh
|
|
13
12
|
|
|
14
|
-
#
|
|
15
|
-
RUN
|
|
13
|
+
# Install runtime libraries and temporary build tools
|
|
14
|
+
RUN apk update && \
|
|
15
|
+
apk add --no-cache libpq && \
|
|
16
|
+
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev
|
|
16
17
|
|
|
17
18
|
COPY requirements.txt .
|
|
18
19
|
|
|
19
|
-
# Upgrade
|
|
20
|
+
# Upgrade pip, install dependencies, clear caches, and NUKE package managers
|
|
20
21
|
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
|
|
22
|
+
pip install --no-cache-dir -r requirements.txt && \
|
|
23
|
+
find / -type d -name "ensurepip" -exec rm -rf {} + || true && \
|
|
21
24
|
rm -rf /root/.cache/pip && \
|
|
22
|
-
|
|
25
|
+
pip uninstall -y setuptools wheel pip
|
|
23
26
|
|
|
24
|
-
#
|
|
25
|
-
RUN
|
|
27
|
+
# Remove the build tools to shrink the image and reduce attack surface
|
|
28
|
+
RUN apk del .build-deps
|
|
26
29
|
|
|
27
30
|
# Copy with ownership
|
|
28
31
|
COPY --chown=appuser:appuser . .
|