2026-06-13 17:21:05 +02:00
|
|
|
# Stage 1: build the React SPA.
|
|
|
|
|
# Pin to the native build host ($BUILDPLATFORM) so the Node/V8 build never runs
|
|
|
|
|
# under QEMU during multi-arch builds — emulated Node crashes V8's baseline JIT
|
|
|
|
|
# (SIGTRAP / exit 133 on `npm ci`). The dist/ output is static JS/CSS, i.e.
|
|
|
|
|
# architecture-independent, so building it once and COPYing it into each
|
|
|
|
|
# target-arch runtime stage is both correct and avoids the emulator entirely.
|
|
|
|
|
FROM --platform=$BUILDPLATFORM node:22-slim AS frontend-build
|
2026-06-13 11:48:32 +02:00
|
|
|
|
|
|
|
|
WORKDIR /frontend
|
|
|
|
|
|
|
|
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
|
|
|
RUN npm ci
|
|
|
|
|
|
|
|
|
|
COPY frontend/ ./
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
# Stage 2: python runtime (no node)
|
2026-04-19 20:19:58 +02:00
|
|
|
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
|
|
|
PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
COPY requirements.txt ./
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
COPY app ./app
|
2026-04-20 15:16:47 +02:00
|
|
|
COPY alembic_app ./alembic_app
|
|
|
|
|
COPY alembic_app.ini ./
|
2026-04-19 20:19:58 +02:00
|
|
|
COPY scripts ./scripts
|
2026-04-20 20:40:04 +02:00
|
|
|
COPY docker ./docker
|
2026-04-19 20:19:58 +02:00
|
|
|
COPY README.md ./
|
|
|
|
|
RUN mkdir -p /app/data
|
|
|
|
|
|
2026-06-13 11:48:32 +02:00
|
|
|
# Copy the built SPA dist from the frontend-build stage
|
|
|
|
|
COPY --from=frontend-build /frontend/dist ./frontend/dist
|
|
|
|
|
|
2026-04-19 20:19:58 +02:00
|
|
|
EXPOSE 8000
|
|
|
|
|
|
2026-04-20 20:40:04 +02:00
|
|
|
ENTRYPOINT ["/app/docker/entrypoint.sh"]
|
2026-04-22 13:28:00 +02:00
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|