# Dockerfile.soul-demo — Soul-demo as a standalone Cloud Run service.
# Decoupled from neuron-web so it can scale independently.
# Built from repo root. soul-demo binary compiled by CI before this runs.

FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
        libcurl4t64 \
        libssl3t64 \
        ca-certificates \
 && rm -rf /var/lib/apt/lists/* \
 && groupadd -r soul && useradd -r -g soul soul \
 && mkdir -p /srv/soul/engram-demo \
 && chown -R soul:soul /srv/soul

COPY dist/soul-demo /usr/local/bin/soul-demo
RUN chmod +x /usr/local/bin/soul-demo

COPY dist/engram-snapshot.json /srv/soul/engram-demo/snapshot.json
RUN chown soul:soul /srv/soul/engram-demo/snapshot.json

USER soul

ENV NEURON_HOME=/srv/soul/engram-demo
ENV NEURON_PORT=8080

EXPOSE 8080

CMD ["/usr/local/bin/soul-demo"]
