FROM docker.artifactory.us.caas.oneadp.com/innerspace/python:3.12-chainguard-dev-uv AS dev

ENV PATH=/app/.venv/bin:$PATH

WORKDIR /app
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen

FROM docker.artifactory.us.caas.oneadp.com/innerspace/python:3.12-chainguard

WORKDIR /app
COPY src/ ./src/
COPY bigmind/ ./bigmind/
COPY --from=dev /app/.venv /app/.venv

ENV PATH=/app/.venv/bin:$PATH
# In Docker, store the DB in /data — mount a volume there for persistence:
# docker run -v /host/path:/data ...
ENV BIGMIND_DB_PATH=/data/memory.db

CMD ["python", "src/server.py"]

