Add OCaml SX kernel build to sx_docs Docker image and enable in production
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 10m16s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 23:34:50 +00:00
parent 313f7d6be1
commit 5ab3ecb7e0
2 changed files with 16 additions and 0 deletions

View File

@@ -228,6 +228,8 @@ services:
<<: *app-env
REDIS_URL: redis://redis:6379/10
WORKERS: "1"
SX_USE_OCAML: "1"
SX_OCAML_BIN: "/app/bin/sx_server"
db:
image: postgres:16

View File

@@ -1,5 +1,16 @@
# syntax=docker/dockerfile:1
# --- Stage 1: Build OCaml SX kernel ---
FROM ocaml/opam:debian-12-ocaml-5.2 AS ocaml-build
USER opam
WORKDIR /home/opam/sx
COPY --chown=opam:opam hosts/ocaml/dune-project ./
COPY --chown=opam:opam hosts/ocaml/lib/ ./lib/
COPY --chown=opam:opam hosts/ocaml/bin/dune hosts/ocaml/bin/run_tests.ml \
hosts/ocaml/bin/debug_set.ml hosts/ocaml/bin/sx_server.ml ./bin/
RUN eval $(opam env) && dune build bin/sx_server.exe
# --- Stage 2: Python app ---
FROM python:3.11-slim AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -49,6 +60,9 @@ COPY likes/models/ ./likes/models/
COPY orders/__init__.py ./orders/__init__.py
COPY orders/models/ ./orders/models/
# OCaml SX kernel binary
COPY --from=ocaml-build /home/opam/sx/_build/default/bin/sx_server.exe /app/bin/sx_server
COPY sx/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh