# ONE-server end-to-end node for chlift v1.0.0: Ubuntu 24.04, systemd PID 1, sshd key auth, Docker + compose v2 (PeerDB),
# and Postgres 16 as the source on the same host.
FROM ubuntu:24.04
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq systemd systemd-sysv openssh-server sudo procps \
      ca-certificates curl docker.io docker-compose-v2 postgresql-16 >/dev/null \
 && apt-get clean && sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/; s/^#\?PermitRootLogin.*/PermitRootLogin prohibit-password/' /etc/ssh/sshd_config \
 && mkdir -p /root/.ssh && chmod 700 /root/.ssh && systemctl enable ssh docker postgresql >/dev/null 2>&1
COPY authorized_keys /root/.ssh/authorized_keys
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
