fix(api): use repo-root-relative paths in Dockerfile for context: .

The CI build-and-push-api job uses context: . (repo root), so all
COPY paths must be relative to the repo root, not the api/ directory.

Also installs ./common/ alongside the api package, matching the
receiptwitness Dockerfile pattern.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
cartsnitch-ci[bot]
2026-03-31 00:37:17 +00:00
parent f23e2786e8
commit d41e8159d0
+8 -6
View File
@@ -5,19 +5,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Build context is the repo root. These paths are relative to the root.
WORKDIR /app
COPY pyproject.toml ./
COPY src/ ./src/
RUN pip install --no-cache-dir --prefix=/install .
COPY api/pyproject.toml ./
COPY api/src/ ./src/
COPY common/ ./common/
RUN pip install --no-cache-dir --prefix=/install ./common/ .
FROM python:3.12-slim AS prod
WORKDIR /app
RUN adduser --system --group --uid 1000 app
COPY --from=build /install /usr/local
COPY src/ ./src/
COPY alembic.ini ./
COPY alembic/ ./alembic/
COPY api/src/ ./src/
COPY api/alembic.ini ./
COPY api/alembic/ ./alembic/
USER 1000
EXPOSE 8000