docker-znc/Dockerfile

43 lines
1.3 KiB
Docker
Raw Normal View History

2015-01-06 18:56:01 -08:00
FROM ubuntu:14.04
MAINTAINER Dave P
# Admin user
RUN useradd --create-home --groups sudo admin ; echo "admin:admin" | chpasswd ; locale-gen en
# ZNC user
RUN useradd --create-home znc ; echo "znc:znc" | chpasswd
2015-01-24 15:54:45 -08:00
# Install sshd, znc, znc extras, nginx, pisg
2015-03-15 17:58:48 -07:00
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-full irssi screen
2015-01-06 18:56:01 -08:00
# Get ZNC source
RUN su -c 'cd /home/znc ; apt-get source znc' znc
# Set nginx workers to a low number
2015-01-24 00:08:29 -08:00
RUN 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
# Turn off nginx daemon mode
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
2015-01-24 00:05:29 -08:00
# Set up nginx
COPY default /etc/nginx/sites-available/default
2015-01-24 15:54:45 -08:00
# Install pisg stuff for log generation
2015-02-15 10:25:32 -08:00
RUN su -c 'mkdir /home/znc/pisg /home/znc/pisg/cache /home/znc/pisg/output /home/znc/pisg/output/.pub' znc
2015-01-24 15:54:45 -08:00
COPY pisg.py /home/znc/pisg/
2015-02-16 12:13:11 -08:00
RUN chmod +x /home/znc/pisg/pisg.py ; chown znc /home/znc/pisg/pisg.py
2015-01-24 15:54:45 -08:00
# Install crontab
COPY crontab /tmp/
RUN crontab -u znc /tmp/crontab
RUN rm /tmp/crontab
2015-01-24 15:54:45 -08:00
# Install startup stuff
COPY daemons.conf /etc/supervisor/conf.d/daemons.conf
COPY start /start
RUN chmod +x /start
2015-01-24 15:54:45 -08:00
# ssh
EXPOSE 22
# nginx
EXPOSE 80