# MySQL Router, one per member, so the workload has seven distinct origins.
#
# Built here rather than pulled: the official router image expects to bootstrap
# against InnoDB Cluster metadata, and this lab runs plain Group Replication with
# no such schema. What is needed is the router binary plus a static routing
# config, which is what start.sh writes.
#
# The deploy builds this on first use and reuses it afterwards.
FROM oraclelinux:8

RUN dnf install -y https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm \
 && dnf install -y --enablerepo=mysql-tools-community mysql-router \
 && dnf clean all \
 && rm -rf /var/cache/dnf

RUN useradd -ms /bin/bash mysql 2>/dev/null || true

COPY start.sh /start.sh
RUN chmod 0755 /start.sh

EXPOSE 5306
USER mysql
CMD ["/start.sh"]
