# Alpine OpenSSH fixture for the source-install harness.
#
# Base image is the reg.rsxx.ru mirror (alpine:3). openrc is installed
# explicitly so init-system detection has a stable marker; openssh is the
# minimal sshd. Password auth is disabled; the fixture authenticates with
# the shared test key.
FROM reg.rsxx.ru/library/alpine:3

RUN apk add --no-cache openssh openrc \
    && mkdir -p /run/sshd /root/.ssh \
    && chmod 700 /root/.ssh \
    && ssh-keygen -A \
    && sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
    && sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config \
    && sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/' /etc/ssh/sshd_config

COPY keys/rsmon_test_ed25519.pub /root/.ssh/authorized_keys
RUN chmod 600 /root/.ssh/authorized_keys

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-e"]
