diff --git a/Dockerfile b/Dockerfile index c92ff6a..b96db27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,18 @@ FROM php:apache -RUN set -x \ - # Install xkcd - apt -y install python3-pkg-resources python3 xkcdpass +#Start an enable SSH +COPY entrypoint.sh ./ +RUN apt-get update \ + && apt-get install -y --no-install-recommends dialog \ + && apt-get install -y --no-install-recommends openssh-server \ + #XKCD + && apt-get -y install python3-pkg-resources python3 xkcdpass \ + && echo "root:Docker!" | chpasswd \ + && chmod u+x ./entrypoint.sh +COPY sshd_config /etc/ssh/ COPY index.php /var/www/html/ -EXPOSE 80 \ No newline at end of file + +EXPOSE 80 8000 2222 + +ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..cbfdd61 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +service ssh start +exec gunicorn -w 4 -b 0.0.0.0:8000 app:app \ No newline at end of file diff --git a/sshd_config b/sshd_config new file mode 100644 index 0000000..c485da5 --- /dev/null +++ b/sshd_config @@ -0,0 +1,12 @@ +Port 2222 +ListenAddress 0.0.0.0 +LoginGraceTime 180 +X11Forwarding yes +Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr +MACs hmac-sha1,hmac-sha1-96 +StrictModes yes +SyslogFacility DAEMON +PasswordAuthentication yes +PermitEmptyPasswords no +PermitRootLogin yes +Subsystem sftp internal-sftp \ No newline at end of file