Add Core Hub staging deployment profile

This commit is contained in:
2026-06-27 21:11:46 +02:00
parent f280f9b0f8
commit b895d1f772
12 changed files with 519 additions and 2 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Stage 1: install production dependencies into an isolated virtualenv.
FROM python:3.12-slim AS builder
RUN pip install uv --no-cache-dir
WORKDIR /app
COPY pyproject.toml uv.lock README.md ./
COPY src/ ./src/
COPY alembic.ini ./
COPY migrations/ ./migrations/
COPY scripts/ ./scripts/
RUN uv sync --no-dev --frozen
# Stage 2: runtime image for API and migration job commands.
FROM python:3.12-slim AS runtime
WORKDIR /app
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app/src /app/src
COPY --from=builder /app/alembic.ini /app/alembic.ini
COPY --from=builder /app/migrations /app/migrations
COPY --from=builder /app/scripts /app/scripts
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH="/app/src"
ENV CORE_HUB_ENV="staging"
ENV CORE_HUB_AUTO_CREATE_TABLES="0"
EXPOSE 8010
CMD ["uvicorn", "core_hub.app:app", "--host", "0.0.0.0", "--port", "8010"]