File size: 1,257 Bytes
d2d1903
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b99f899
d2d1903
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# OrgState Engine — production image for the unified monorepo.
# Builds ONLY the new packages (core / verticals / infra / harness). legacy/,
# docs/, gtm/ and tests/ are excluded via .dockerignore — see MIGRATION_MAP.md.
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    ORGSTATE_DB_PATH=/data/orgstate.sqlite3 \
    ORGSTATE_HOST=0.0.0.0 \
    ORGSTATE_PORT=8080

WORKDIR /app

RUN apt-get update \
 && apt-get install -y --no-install-recommends curl ca-certificates \
 && rm -rf /var/lib/apt/lists/*

# deps first for layer caching
COPY requirements-runtime.txt .
RUN pip install --no-cache-dir -r requirements-runtime.txt

# the new monorepo packages only
COPY core/      ./core/
COPY verticals/ ./verticals/
COPY infra/     ./infra/
COPY harness/   ./harness/
COPY delivery/  ./delivery/
COPY pyproject.toml ./

# shared data volume — API and scheduler both point ORGSTATE_DB_PATH here
RUN mkdir -p /data
VOLUME ["/data"]

EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
  CMD curl -fsS http://localhost:${ORGSTATE_PORT}/health || exit 1

# default process is the API; the scheduler overrides CMD (see docker-compose.yml)
CMD ["bash", "infra/deployment/scripts/start_api.sh"]