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,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,20 +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
|
-
#
|
|
21
|
-
RUN pip install --upgrade pip setuptools wheel
|
|
22
|
-
|
|
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-
|
|
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
|
-
#
|
|
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
|
-
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
|
-
#
|
|
23
|
-
RUN
|
|
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 . .
|