forked from cartsnitch/cartsnitch
feat(ci): add receiptwitness build job to monorepo CI
This commit is contained in:
+10
-13
@@ -3,24 +3,21 @@ FROM python:3.12-slim AS build
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# git is required to install cartsnitch-common from GitHub; build-essential and
|
# build-essential and libpq-dev are needed to compile any C-extension wheels
|
||||||
# libpq-dev are needed to compile any C-extension wheels (e.g. psycopg2 fallback)
|
# (e.g. psycopg2 fallback). No git needed — common/ is copied from the repo root.
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
git \
|
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
build-essential \
|
build-essential \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY pyproject.toml ./
|
# Build context is the repo root. These paths are relative to the root.
|
||||||
COPY src/ ./src/
|
COPY receiptwitness/pyproject.toml ./
|
||||||
|
COPY receiptwitness/src/ ./src/
|
||||||
|
COPY common/ ./common/
|
||||||
|
|
||||||
# cartsnitch-common is not on PyPI — install it directly from GitHub, then
|
# Install from the local common/ (cartsnitch-common>=0.1.0 in pyproject.toml
|
||||||
# install the rest of the package dependencies in a single resolver pass so
|
# will be satisfied by the local package) then install receiptwitness itself.
|
||||||
# pip can satisfy the cartsnitch-common>=0.1.0 constraint declared in
|
RUN pip install --no-cache-dir --prefix=/install ./common/ .
|
||||||
# pyproject.toml without hitting PyPI for it.
|
|
||||||
RUN pip install --no-cache-dir --prefix=/install \
|
|
||||||
"cartsnitch-common @ git+https://github.com/cartsnitch/common.git@76685ed0384103228cd670b477b967e7752ebe6b" \
|
|
||||||
.
|
|
||||||
|
|
||||||
# Stage 2: Production image with Playwright + Chromium
|
# Stage 2: Production image with Playwright + Chromium
|
||||||
FROM python:3.12-slim AS prod
|
FROM python:3.12-slim AS prod
|
||||||
@@ -51,7 +48,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
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 receiptwitness/src/ ./src/
|
||||||
|
|
||||||
# Install Playwright Chromium browser (runs as root; /opt/playwright is world-readable)
|
# Install Playwright Chromium browser (runs as root; /opt/playwright is world-readable)
|
||||||
RUN PLAYWRIGHT_BROWSERS_PATH=/opt/playwright playwright install chromium
|
RUN PLAYWRIGHT_BROWSERS_PATH=/opt/playwright playwright install chromium
|
||||||
|
|||||||
Reference in New Issue
Block a user