Skip to content

Commit

Permalink
configure sshd. #185
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jan 12, 2019
1 parent ffc60ed commit c2d4769
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ LABEL maintainer="[email protected]"

# 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
Expand All @@ -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 && \
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
image: datacite/lupo
ports:
- "8065:80"
- "2265:22"
volumes:
- ./app:/home/app/webapp/app
- ./config:/home/app/webapp/config
Expand Down
4 changes: 3 additions & 1 deletion vendor/docker/10_ssh.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion vendor/docker/authorized_keys.tmpl

This file was deleted.

0 comments on commit c2d4769

Please sign in to comment.