FROM alpine:3.22 RUN apk update && apk upgrade && apk add --no-cache \ git \ docker-cli \ docker-cli-compose \ bash \ fish \ zsh \ wget \ curl \ htop \ vim \ nano \ tmux \ openssh-server \ iproute2 # Download ttyd RUN wget -O /usr/local/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 && chmod +x /usr/local/bin/ttyd # Configure SSH RUN mkdir -p /var/run/sshd && \ sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config # Copy entrypoint script COPY entrypoint.sh /app/ COPY service.ssh.sh /app/ COPY service.ttyd.sh /app/ RUN chmod +x /app/entrypoint.sh /app/service.ssh.sh /app/service.ttyd.sh COPY motd.txt /etc/motd RUN mkdir -p /srv/stack WORKDIR /srv/stack # Set environment variable for Docker Compose project name # This is needed because inside ttyd docker compose defaults to hostname + directory for the project name ENV COMPOSE_PROJECT_NAME=stack EXPOSE 22 1234 ENTRYPOINT ["/app/entrypoint.sh"]