fix: runtime stage also uses base image
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Problem: Runtime stage was installing Node.js again! Solution: Use base image for runtime too - Already has Python 3.11 ✅ - Already has Node.js 20 ✅ - Already has curl, ca-certificates ✅ - Only install tini (tiny) This is the CORRECT way to use base image!
This commit is contained in:
@@ -68,9 +68,9 @@ RUN --mount=type=cache,target=/root/.npm \
|
|||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# Stage 2: Runtime
|
# Stage 2: Runtime (using base image for Node.js)
|
||||||
# ============================================
|
# ============================================
|
||||||
FROM python:3.11-slim AS runtime
|
FROM ${BASE_IMAGE} AS runtime
|
||||||
|
|
||||||
LABEL org.opencontainers.image.title="Peikarband Landing"
|
LABEL org.opencontainers.image.title="Peikarband Landing"
|
||||||
LABEL org.opencontainers.image.description="Peikarband hosting platform landing page"
|
LABEL org.opencontainers.image.description="Peikarband hosting platform landing page"
|
||||||
@@ -84,21 +84,16 @@ RUN groupadd -r peikarband && \
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install runtime dependencies only
|
# Base image already has:
|
||||||
|
# - Python 3.11
|
||||||
|
# - Node.js 20
|
||||||
|
# - curl, ca-certificates
|
||||||
|
# Just need to add tini for proper init
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
|
||||||
ca-certificates \
|
|
||||||
tini \
|
tini \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
# Install Node.js runtime
|
|
||||||
ARG NODE_VERSION=20
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
|
|
||||||
&& apt-get install -y --no-install-recommends nodejs \
|
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& apt-get clean
|
|
||||||
|
|
||||||
# Copy Python dependencies from builder
|
# Copy Python dependencies from builder
|
||||||
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
||||||
COPY --from=builder /usr/local/bin /usr/local/bin
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
||||||
|
|||||||
Reference in New Issue
Block a user