diff --git a/Dockerfile b/Dockerfile index 6e6a88a4a..e384cb55a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ LABEL maintainer="kgarza@datacite.org" # Set correct environment variables. ENV HOME /home/app -ENV DOCKERIZE_VERSION v0.6.0 # Allow app user to read /etc/container_environment RUN usermod -a -G docker_env app @@ -19,13 +18,6 @@ RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && apt-get install ntp wget tzdata pandoc -y && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -# install dockerize -RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && \ - tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz - -# enable SSH -RUN rm -f /etc/service/sshd/down - # Enable Passenger and Nginx and remove the default site # Preserve env variables for nginx RUN rm -f /etc/service/nginx/down && \ @@ -53,6 +45,10 @@ RUN mkdir -p tmp/pids && \ chown -R app:app /home/app/webapp && \ chmod -R 755 /home/app/webapp +# enable SSH +RUN rm -f /etc/service/sshd/down && \ + /etc/my_init.d/00_regen_ssh_host_keys.sh + # Install Ruby gems for middleman WORKDIR /home/app/webapp/vendor/middleman RUN /sbin/setuser app bundle install diff --git a/docker-compose.yml b/docker-compose.yml index ad7fd4dc2..999522862 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: image: datacite/lupo ports: - "8065:80" + - "2265:22" volumes: - ./app:/home/app/webapp/app - ./config:/home/app/webapp/config diff --git a/vendor/docker/10_ssh.sh b/vendor/docker/10_ssh.sh index 233671d1b..b6b27ea62 100755 --- a/vendor/docker/10_ssh.sh +++ b/vendor/docker/10_ssh.sh @@ -1,2 +1,4 @@ #!/bin/sh -dockerize -template /home/app/webapp/vendor/docker/authorized_keys.tmpl:/root/.ssh/authorized_keys +if [ "${PUBLIC_KEY}" ]; then + echo "${PUBLIC_KEY}" > /root/.ssh/authorized_keys +fi diff --git a/vendor/docker/authorized_keys.tmpl b/vendor/docker/authorized_keys.tmpl deleted file mode 100644 index 45590915c..000000000 --- a/vendor/docker/authorized_keys.tmpl +++ /dev/null @@ -1 +0,0 @@ -{{ .Env.PUBLIC_KEY }} \ No newline at end of file