Fix SSH key and config persistence

Signed-off-by: Billy Brawner <billy@wbrawner.com>
This commit is contained in:
Billy Brawner 2019-12-22 15:37:32 -06:00
parent 3d646b4e68
commit ec2ba06453
2 changed files with 11 additions and 4 deletions

View file

@ -2,15 +2,12 @@ FROM alpine:latest
RUN apk add git apache2 openssh cgit py3-markdown py3-pygments
COPY sshd_config /etc/ssh/sshd_config
COPY sshd_config /sshd_config
COPY httpd.conf /etc/apache2/httpd.conf
COPY cgitrc /etc/cgitrc
COPY entrypoint.sh /entrypoint.sh
COPY update-mirrors.sh /update-mirrors.sh
# Generate host keys for the server
RUN ssh-keygen -A
# Create directory for cgit config
RUN mkdir -p /etc/cgit.d

View file

@ -2,6 +2,16 @@
set -m
# Create host keys if they haven't been created already
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -A
fi
# Copy the SSH config if it hasn't already been setup
if [ ! -f /etc/ssh/sshd_config ]; then
cp /sshd_config /etc/ssh/sshd_config
fi
/usr/sbin/sshd -De &
/usr/sbin/crond -fd8 &