feat(ci): add build-and-push-api job for ghcr.io/cartsnitch/api
Merges PR #75. QA-approved (Checkout Charlie) and CTO-approved (Savannah Savings). All CI checks pass. Resolves CAR-221, unblocks auth restoration (CAR-200).
This commit is contained in:
+8
-5
@@ -1,3 +1,5 @@
|
|||||||
|
# Stage 1: Build dependencies
|
||||||
|
# Build context is the repo root. Paths below are relative to the root.
|
||||||
FROM python:3.12-slim AS build
|
FROM python:3.12-slim AS build
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
@@ -6,18 +8,19 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY pyproject.toml ./
|
COPY api/pyproject.toml ./
|
||||||
COPY src/ ./src/
|
COPY api/src/ ./src/
|
||||||
RUN pip install --no-cache-dir --prefix=/install .
|
RUN pip install --no-cache-dir --prefix=/install .
|
||||||
|
|
||||||
|
# Stage 2: Production image
|
||||||
FROM python:3.12-slim AS prod
|
FROM python:3.12-slim AS prod
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN adduser --system --group --uid 1000 app
|
RUN adduser --system --group --uid 1000 app
|
||||||
COPY --from=build /install /usr/local
|
COPY --from=build /install /usr/local
|
||||||
COPY src/ ./src/
|
COPY api/src/ ./src/
|
||||||
COPY alembic.ini ./
|
COPY api/alembic.ini ./
|
||||||
COPY alembic/ ./alembic/
|
COPY api/alembic/ ./alembic/
|
||||||
|
|
||||||
USER 1000
|
USER 1000
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|||||||
Reference in New Issue
Block a user