# koopa-bbb-front — BigBlueButton front (Ubuntu)
# Exception to CachyOS policy: BBB packages and install scripts target Ubuntu.
# Build: bash ~/koopa-admin-log/scripts/bbb/build.sh → localhost/koopa-bbb-front:ubuntu
#
# Placeholder reverse-proxy target (nginx) until Greenlight and/or BBB core
# (bbb-install on Ubuntu) is chosen. Not production BBB media.

ARG UBUNTU_IMAGE=docker.io/library/ubuntu:24.04
FROM ${UBUNTU_IMAGE}

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=Europe/Zurich

RUN apt-get update \
 && apt-get install -y --no-install-recommends \
      ca-certificates curl nginx tini \
 && rm -rf /var/lib/apt/lists/*

RUN printf '%s\n' \
      'server {' \
      '  listen 80 default_server;' \
      '  root /var/www/html;' \
      '  index index.html;' \
      '  location = /health { access_log off; default_type text/plain; return 200 "ok\n"; }' \
      '  location / { try_files $uri $uri/ =404; }' \
      '}' > /etc/nginx/sites-available/default \
 && printf '%s\n' \
      '<!doctype html><meta charset=utf-8><title>bbb.hacktivism.ch</title>' \
      '<p>BBB front stub (Ubuntu 24.04). Full BigBlueButton / Greenlight is a separate Ubuntu install step.</p>' \
      > /var/www/html/index.html

COPY entrypoint.sh /docker-entrypoint.sh
RUN chmod 755 /docker-entrypoint.sh

EXPOSE 80
ENTRYPOINT ["/usr/bin/tini", "--", "/docker-entrypoint.sh"]
