From 9ffe88b6039ad521779063166b065786ea4b6516 Mon Sep 17 00:00:00 2001 From: dave Date: Fri, 23 Jan 2015 23:50:17 -0800 Subject: [PATCH] Re-arrange dockerfile to use cache from previous committed versions --- Dockerfile | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7ef45f..d6f2dd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,36 +7,39 @@ RUN useradd --create-home --groups sudo admin ; echo "admin:admin" | chpasswd ; RUN useradd --create-home znc ; echo "znc:znc" | chpasswd # Install sshd, znc, and znc extras -RUN mkdir /var/run/sshd ; apt-get update ; apt-get install -y supervisor vim openssh-server znc znc-python znc-dev dpkg-dev pisg nginx-light +RUN mkdir /var/run/sshd ; apt-get update ; apt-get install -y supervisor vim openssh-server znc znc-python znc-dev dpkg-dev # Get ZNC source RUN su -c 'cd /home/znc ; apt-get source znc' znc -# Set nginx workers to a low number -RNN sed -i -e"s/^worker_processes\s*4/worker_processes 1/" /etc/nginx/nginx.conf -# Set nginx user to ZNC user -RUN sed -i -e"s/^user\s*www\-data/user znc/" /etc/nginx/nginx.conf -# Set nginx root -RUN sed -i -e"s/^\s*root\s*\/usr\/share\/nginx\/html/ root \/home\/znc\/pisg\/output/" /etc/nginx/sites-enabled/default -# Make pisg root -RUN su -c "mkdir /home/znc/pisg ; mkdir /home/znc/pisg/output ; mkdir /home/znc/pisg/config" znc -# Turn off nginx daemon -RUN echo "daemon off;" >> /etc/nginx/nginx.conf -# Install crontab -COPY crontab /tmp/ -RUN crontab -u znc /tmp/crontab -RUN rm /tmp/crontab -# Install stuff for log generation -RUN mkdir /home/znc/pisg /home/znc/pisg/cache /home/znc/pisg/output -COPY pisg.py /home/znc/pisg/ -RUN chmod +x /home/znc/pisg/pisg.py - # Install startup stuff COPY daemons.conf /etc/supervisor/conf.d/daemons.conf COPY start /start RUN chmod +x /start # Ports -EXPOSE 80 EXPOSE 22 +# Pisg dir +RUN mkdir /home/znc/pisg /home/znc/pisg/cache /home/znc/pisg/output +# Pisg and nginx +RUN apt-get install pisg nginx-light +# Set nginx workers to a low number +RNN sed -i -e"s/^worker_processes\s*4/worker_processes 1/" /etc/nginx/nginx.conf +# Set nginx user to ZNC user +RUN sed -i -e"s/^user\s*www\-data/user znc/" /etc/nginx/nginx.conf +# Set nginx root +RUN sed -i -e"s/^\s*root\s*\/usr\/share\/nginx\/html/ root \/home\/znc\/pisg\/output/" /etc/nginx/sites-enabled/default +# Turn off nginx daemon mode +RUN echo "daemon off;" >> /etc/nginx/nginx.conf +# Install crontab +COPY crontab /tmp/ +RUN crontab -u znc /tmp/crontab +RUN rm /tmp/crontab +# Install stuff for log generation + +COPY pisg.py /home/znc/pisg/ +RUN chmod +x /home/znc/pisg/pisg.py + +# Expose nginx +EXPOSE 80