deploy-stack 0.9.8 → 0.9.10

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.9.8",
3
+ "version": "0.9.10",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- FROM python:3.12-slim
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,20 +6,26 @@ ENV PYTHONUNBUFFERED=1
6
6
 
7
7
  WORKDIR /app
8
8
 
9
- # Upgrade Debian OS packages to patch system-level CVEs (like python3-setuptools)
10
- RUN apt-get update && apt-get upgrade -y && \
11
- apt-get install -y --no-install-recommends gcc libpq-dev && \
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
- # Create unprivileged user
15
- RUN groupadd -g 1001 appgroup && \
16
- useradd -u 1001 -g appgroup -s /bin/sh -m appuser
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
- # Patch core python packaging tools to resolve CVEs
21
- RUN pip install --upgrade pip setuptools wheel
22
- RUN pip install --no-cache-dir -r requirements.txt gunicorn
20
+ # Upgrade pip, install dependencies, clear caches, and NUKE package managers
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 && \
24
+ rm -rf /root/.cache/pip && \
25
+ pip uninstall -y setuptools wheel pip
26
+
27
+ # Remove the build tools to shrink the image and reduce attack surface
28
+ RUN apk del .build-deps
23
29
 
24
30
  # Copy code with explicit ownership
25
31
  COPY --chown=appuser:appgroup . .
@@ -1,4 +1,4 @@
1
- FROM python:3.12-slim
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,21 +6,26 @@ ENV PYTHONUNBUFFERED=1
6
6
 
7
7
  WORKDIR /app
8
8
 
9
- # Upgrade Debian OS packages to patch system-level CVEs (like python3-setuptools)
10
- RUN apt-get update && apt-get upgrade -y && \
11
- apt-get install -y --no-install-recommends gcc libpq-dev && \
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
- # Create a non-root user for security compliance
15
- RUN adduser --disabled-password --gecos '' appuser
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 core pip tools to resolve base image CVEs
20
- RUN pip install --upgrade pip setuptools wheel
20
+ # Upgrade pip, install dependencies, clear caches, and NUKE package managers
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 && \
24
+ rm -rf /root/.cache/pip && \
25
+ pip uninstall -y setuptools wheel pip
21
26
 
22
- # Install dependencies without caching to keep the image size small
23
- RUN pip install --no-cache-dir -r requirements.txt
27
+ # Remove the build tools to shrink the image and reduce attack surface
28
+ RUN apk del .build-deps
24
29
 
25
30
  # Copy with ownership
26
31
  COPY --chown=appuser:appuser . .