docker/entrypoint.sh (861B) - raw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36#!/bin/sh set -eu mkdir -p /run/nginx /run/fcgiwrap /run/sshd /etc/ssh/hostkeys chown -R git:git /run/fcgiwrap chown -R git:git /srv/git chown -R git:git /var/www/git chown -R git:git /home/git/.ssh # Generate persistent SSH host keys only once if [ ! -f /etc/ssh/hostkeys/ssh_host_ed25519_key ]; then ssh-keygen -t ed25519 -f /etc/ssh/hostkeys/ssh_host_ed25519_key -N '' fi if [ ! -f /etc/ssh/hostkeys/ssh_host_rsa_key ]; then ssh-keygen -t rsa -b 4096 -f /etc/ssh/hostkeys/ssh_host_rsa_key -N '' fi chmod 700 /home/git/.ssh chmod 600 /home/git/.ssh/authorized_keys chmod 600 /etc/ssh/hostkeys/ssh_host_*_key chmod 644 /etc/ssh/hostkeys/ssh_host_*_key.pub spawn-fcgi \ -s /run/fcgiwrap/fcgiwrap.sock \ -U nginx \ -G nginx \ -u git \ -g git \ -- /usr/bin/fcgiwrap su-exec git:git stagit-rebuild-all /usr/sbin/sshd nginx -g 'daemon off;'