# syntax=docker/dockerfile:1
#
# Belenios 3.3.0 server image (release build).
#
# Build from a source archive so the image does not depend on a local checkout:
#   git archive HEAD | docker build -f deploy/Dockerfile -t belenios:3.3.0 -
#
# The server resolves its extensions through the OPAM findlib tree at runtime,
# so the runtime image is the build image (a slim runtime image does not work).
ARG BASE_IMAGE=glondu/beleniosbase:20260425-1
FROM ${BASE_IMAGE}

ADD --chown=belenios . /home/belenios/belenios
WORKDIR /home/belenios/belenios
RUN . /home/belenios/.belenios/env.sh && make build-release-server

# Default command runs the demo launcher with the deploy config; override it for real use.
ENV BELENIOS_SENDMAIL=tests/sendmail_fake_to_static.sh
# Config for belenios.aman.software behind nginx (listens on 0.0.0.0:8001 inside the container).
ENV BELENIOS_CONFIG=deploy/ocsigenserver.conf.in
CMD ["./demo/run-server.sh"]
