# Shorashim Shoresh Engine โ€” Haskell root activation engine # Construction spec ยง1.1: GHC 9.6.4, Cabal 3.10 # Communicates with vav_pipeline via Erlang Port (stdin/stdout) # === BUILD STAGE === FROM haskell:9.6.4-slim AS build # haskell:9.6.4-slim is Debian Buster (EOL) โ€” use archive repos RUN sed -i 's|deb.debian.org/debian|archive.debian.org/debian|g' /etc/apt/sources.list && \ sed -i 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g' /etc/apt/sources.list && \ sed -i '/buster-updates/d' /etc/apt/sources.list && \ apt-get update && apt-get install -y zlib1g-dev && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy cabal files first for dependency caching COPY shoresh-engine/shoresh-engine.cabal ./ COPY shoresh-engine/cabal.project.freeze ./ RUN cabal update && cabal build --only-dependencies # Copy source and build COPY shoresh-engine/ ./ RUN cabal build && \ cp $(cabal list-bin shoresh-engine) /usr/local/bin/shoresh-engine # === RUNTIME STAGE === FROM ubuntu:jammy-20240125 RUN apt-get update && \ apt-get install -y --no-install-recommends \ libgmp10 zlib1g && \ rm -rf /var/lib/apt/lists/* RUN useradd --create-home --shell /bin/bash shorashim USER shorashim WORKDIR /home/shorashim COPY --from=build /usr/local/bin/shoresh-engine ./shoresh-engine # L1 mount point โ€” the engine reads Torah roots from L1 ENV L1_MOUNT_POINT=/mnt/torah # The engine is invoked as an Erlang Port by vav_pipeline # In K8s, it runs as a sidecar or is called via the Port protocol CMD ["./shoresh-engine"]