# Native OCaml SX server — no Python, no Quart
# Accessible at sx.rose-ash.com via Caddy on externalnet

services:
  sx_docs:
    image: registry.rose-ash.com:5000/sx_docs:latest
    entrypoint: ["/app/bin/sx_server", "--http", "8000"]
    working_dir: /app
    environment:
      SX_PROJECT_DIR: /app
      OCAMLRUNPARAM: "b"
    ports:
      - "8013:8000"
    volumes:
      # SX source files (hot-reload on restart)
      - ./spec:/app/spec:ro
      - ./lib:/app/lib:ro
      - ./web:/app/web:ro
      - ./sx/sx:/app/sx:ro
      - ./sx/sxc:/app/sxc:ro
      - ./shared:/app/shared:ro
      # OCaml binary (rebuild with: cd hosts/ocaml && eval $(opam env) && dune build)
      - ./hosts/ocaml/_build/default/bin/sx_server.exe:/app/bin/sx_server:ro
    networks:
      - externalnet
      - default
    restart: unless-stopped

networks:
  externalnet:
    external: true
