Files
rose-ash/hosts/ocaml/Dockerfile
giles bb34b4948b OCaml raw! in HTML renderer + SX_USE_OCAML env promotion + golden tests
- sx_render.ml: add raw! handler to HTML renderer (inject pre-rendered
  content without HTML escaping)
- docker-compose.yml: move SX_USE_OCAML/SX_OCAML_BIN to shared env
  (available to all services, not just sx_docs)
- hosts/ocaml/Dockerfile: OCaml kernel build stage
- shared/sx/tests/: golden test data + generator for OCaml render tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 22:21:04 +00:00

26 lines
780 B
Docker

# OCaml SX kernel build image.
#
# Produces a statically-linked sx_server binary that can be COPY'd
# into any service's Docker image.
#
# Usage:
# docker build -t sx-kernel -f hosts/ocaml/Dockerfile .
# docker build --target=export -o hosts/ocaml/_build/export -f hosts/ocaml/Dockerfile .
FROM ocaml/opam:debian-12-ocaml-5.2 AS build
USER opam
WORKDIR /home/opam/sx
# Copy only what's needed for the OCaml build
COPY --chown=opam:opam hosts/ocaml/dune-project ./
COPY --chown=opam:opam hosts/ocaml/lib/ ./lib/
COPY --chown=opam:opam hosts/ocaml/bin/ ./bin/
# Build the server binary
RUN eval $(opam env) && dune build bin/sx_server.exe
# Export stage — just the binary
FROM scratch AS export
COPY --from=build /home/opam/sx/_build/default/bin/sx_server.exe /sx_server