2018-10-07 13:50:47 -07:00
|
|
|
FROM ubuntu:bionic
|
2015-02-17 21:37:15 -08:00
|
|
|
|
2018-10-07 13:50:47 -07:00
|
|
|
# Nexus user for application usage
|
2015-12-26 14:01:50 -08:00
|
|
|
RUN useradd --create-home nexus && \
|
2018-10-07 13:50:47 -07:00
|
|
|
echo "nexus:nexus" | chpasswd
|
|
|
|
|
|
|
|
# Packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y nginx-light fcgiwrap supervisor openssh-server cron rsync python3-pip
|
|
|
|
|
|
|
|
# Misc conf
|
|
|
|
RUN mkdir /start.d /nexus /var/run/sshd && \
|
2015-12-26 14:01:50 -08:00
|
|
|
chown nexus /nexus && \
|
2015-12-26 21:13:13 -08:00
|
|
|
rm /etc/ssh/ssh_host_* && \
|
|
|
|
mkdir /etc/ssh/keys && \
|
2018-10-07 13:50:47 -07:00
|
|
|
sed -i -E 's/#?HostKey \/etc\/ssh\//HostKey \/data\/keys\//' /etc/ssh/sshd_config && \
|
2015-12-26 21:13:13 -08:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2015-02-17 21:37:15 -08:00
|
|
|
|
2015-12-26 14:01:50 -08:00
|
|
|
# Supervisor confs
|
|
|
|
ADD supervisor.conf /etc/supervisor/conf.d/supervisor.conf
|
|
|
|
ADD supervisor-nginx.conf /etc/supervisor/conf.d/nginx.conf
|
|
|
|
ADD supervisor-fcgiwrap.conf /etc/supervisor/conf.d/fcgiwrap.conf
|
|
|
|
ADD supervisor-sshd.conf /etc/supervisor/conf.d/sshd.conf
|
|
|
|
ADD supervisor-cron.conf /etc/supervisor/conf.d/cron.conf
|
2015-03-21 11:29:34 -07:00
|
|
|
|
2015-12-26 14:01:50 -08:00
|
|
|
# nginx confs
|
|
|
|
ADD nginx.conf /etc/nginx/nginx.conf
|
2018-10-07 13:50:47 -07:00
|
|
|
ADD default /etc/nginx/sites-available/default
|
|
|
|
ADD fastcgi_params /etc/nginx/fastcgi_params
|
|
|
|
|
|
|
|
# scripts
|
|
|
|
ADD scripts/nexus /tmp/nexus
|
|
|
|
RUN cd /tmp/nexus && python3 setup.py install && rm -rf /tmp/nexus
|
2015-03-21 11:29:34 -07:00
|
|
|
|
2015-12-26 14:01:50 -08:00
|
|
|
# Startup tasks
|
2015-09-07 23:33:32 -07:00
|
|
|
ADD clear-sockets /start.d/clear-sockets
|
|
|
|
ADD gen-ssh /start.d/gen-ssh
|
2018-10-07 13:50:47 -07:00
|
|
|
ADD dir-setup /start.d/dir-setup
|
2015-09-07 23:33:32 -07:00
|
|
|
ADD start /start
|
2015-05-23 15:02:35 -07:00
|
|
|
|
2018-10-07 13:50:47 -07:00
|
|
|
RUN chmod +x /start.d/clear-sockets /start.d/gen-ssh /start.d/dir-setup /start
|
2015-12-26 14:01:50 -08:00
|
|
|
|
|
|
|
ENTRYPOINT ["/start"]
|
2015-03-21 11:29:34 -07:00
|
|
|
|
|
|
|
EXPOSE 80
|
2015-12-26 14:01:50 -08:00
|
|
|
EXPOSE 22
|