Fix SSH key and config persistence
Signed-off-by: Billy Brawner <billy@wbrawner.com>
This commit is contained in:
parent
3d646b4e68
commit
ec2ba06453
2 changed files with 11 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 &
|
||||
|
|
Loading…
Reference in a new issue