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
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:
@@ -228,6 +228,8 @@ services:
|
|||||||
<<: *app-env
|
<<: *app-env
|
||||||
REDIS_URL: redis://redis:6379/10
|
REDIS_URL: redis://redis:6379/10
|
||||||
WORKERS: "1"
|
WORKERS: "1"
|
||||||
|
SX_USE_OCAML: "1"
|
||||||
|
SX_OCAML_BIN: "/app/bin/sx_server"
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# 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
|
FROM python:3.11-slim AS base
|
||||||
|
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||||
@@ -49,6 +60,9 @@ COPY likes/models/ ./likes/models/
|
|||||||
COPY orders/__init__.py ./orders/__init__.py
|
COPY orders/__init__.py ./orders/__init__.py
|
||||||
COPY orders/models/ ./orders/models/
|
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
|
COPY sx/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user