# Observability AI — local API mock for integrating developers.
#
# Serves the client-facing API surface (sessions, stations, anomalies, statistics,
# LLM, batches, webhooks, models, API keys, organization, members) via Stoplight
# Prism. Internal endpoints (billing, admin, debug, …) are NOT included.
#
#   docker build -t obs-ai-mock -f obs-ai-mock.Dockerfile .
#   docker run --rm -p 4010:4010 obs-ai-mock
#   # any bearer token works (without one the mock returns 401):
#   curl -H 'Authorization: Bearer sk-obs-anything' http://localhost:4010/api/saas/v1/sessions
#
# The build fetches the published spec once over the network; the running
# container is fully offline. Prism runs with --dynamic, so it returns data of
# the correct SHAPE generated from the schema — not realistic values.
#
# Pin a different spec (e.g. a locally generated one) with:
#   docker build --build-arg SPEC_URL=http://host.docker.internal:8000/client-openapi.json ...
FROM stoplight/prism:5.15.10

ARG SPEC_URL=https://solidstudio.ai/client-openapi.json
ADD ${SPEC_URL} /tmp/client-openapi.json

EXPOSE 4010
# `-m false` disables Prism's multiprocess fork (it crashes with an `isPrimary`
# TypeError in this image); the spec is the positional document argument.
CMD ["mock", "--host", "0.0.0.0", "--port", "4010", "-m", "false", "--dynamic", "/tmp/client-openapi.json"]
