Compare commits

..

1 Commits

Author SHA1 Message Date
Barcode Betty cd28d1535a fix(api): include alembic.ini and alembic/ in API Docker image 2026-03-30 20:48:18 +00:00
2 changed files with 17 additions and 9 deletions
+7 -3
View File
@@ -6,8 +6,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY pyproject.toml ./
COPY src/ ./src/
COPY api/pyproject.toml ./
COPY api/src/ ./src/
COPY api/alembic.ini ./
COPY api/alembic/ ./alembic/
RUN pip install --no-cache-dir --prefix=/install .
FROM python:3.12-slim AS prod
@@ -15,7 +17,9 @@ 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 api/src/ ./src/
COPY api/alembic.ini ./
COPY api/alembic/ ./alembic/
USER 1000
EXPOSE 8000
+10 -6
View File
@@ -3,9 +3,10 @@ FROM python:3.12-slim AS build
WORKDIR /app
# build-essential and libpq-dev are needed to compile any C-extension wheels
# (e.g. psycopg2 fallback). git is no longer needed here.
# git is required to install cartsnitch-common from GitHub; build-essential and
# libpq-dev are needed to compile any C-extension wheels (e.g. psycopg2 fallback)
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
libpq-dev \
build-essential \
&& rm -rf /var/lib/apt/lists/*
@@ -13,10 +14,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY pyproject.toml ./
COPY src/ ./src/
# cartsnitch-common is not on PyPI — install it from the local monorepo common/
# directory. The common/ dir is the cartsnitch-common Python package.
COPY common/ /tmp/common/
RUN pip install --no-cache-dir --prefix=/install /tmp/common/ .
# cartsnitch-common is not on PyPI — install it directly from GitHub, then
# install the rest of the package dependencies in a single resolver pass so
# pip can satisfy the cartsnitch-common>=0.1.0 constraint declared in
# 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
FROM python:3.12-slim AS prod