Browse Source

Remove base image dependency

master
dpedu 6 years ago
parent
commit
c815426c5a
  1. 21
      Dockerfile
  2. 2
      clear-sockets
  3. 3
      cron.conf
  4. 4
      gen-ssh
  5. 3
      sshd.conf
  6. 10
      start
  7. 2
      supervisor.conf

21
Dockerfile

@ -1,4 +1,4 @@
FROM basessh
FROM ubuntu:trusty
MAINTAINER Dave P
# Create nexus user
@ -6,17 +6,24 @@ RUN useradd --create-home nexus ; \
echo "nexus:nexus" | chpasswd
# Install nginx
RUN apt-get install -y nginx-light fcgiwrap
RUN apt-get update ;\
apt-get install -y nginx-light fcgiwrap supervisor openssh-server cron ;\
mkdir /start.d /nexus /var/run/sshd ;\
chown nexus /nexus
# Configure nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf ; cp /usr/share/doc/fcgiwrap/examples/nginx.conf /etc/nginx/fcgiwrap.conf
COPY nginx.conf /etc/supervisor/conf.d/nginx.conf
COPY fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
COPY default /etc/nginx/sites-available/default
COPY clear-sockets /start.d/clear-sockets
ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
ADD nginx.conf /etc/supervisor/conf.d/nginx.conf
ADD fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
ADD sshd.conf /etc/supervisor/conf.d/sshd.conf
ADD cron.conf /etc/supervisor/conf.d/cron.conf
ADD default /etc/nginx/sites-available/default
ADD clear-sockets /start.d/clear-sockets
ADD gen-ssh /start.d/gen-ssh
ADD start /start
RUN chmod +x /start.d/clear-sockets
EXPOSE 80

2
clear-sockets

@ -1,3 +1,3 @@
#!/bin/sh
rm /tmp/fcgiwrap.socket
rm -f /tmp/fcgiwrap.socket

3
cron.conf

@ -0,0 +1,3 @@
[program:cron]
command=/usr/sbin/cron -f
autorestart=true

4
gen-ssh

@ -0,0 +1,4 @@
# Regenerate ssh key per container
dpkg-reconfigure openssh-server
rm /start.d/gen-ssh

3
sshd.conf

@ -0,0 +1,3 @@
[program:sshd]
command=/usr/sbin/sshd -D
autorestart=true

10
start

@ -1,14 +1,12 @@
#!/bin/bash
if [ ! -f /etc/ssh/sshd_config ]; then
# Regenerate ssh key per container
dpkg-reconfigure openssh-server
fi
chown nexus /nexus
# run everything in start.d
find /start.d -type f -executable -exec {} \;
# Cleanly kill supervisor when container is stopped
trap 'kill $(jobs -p)' EXIT
chown nexus /nexus
# start services
supervisord

2
supervisor.conf

@ -0,0 +1,2 @@
[supervisord]
nodaemon=true
Loading…
Cancel
Save