-
Notifications
You must be signed in to change notification settings - Fork 34
/
Dockerfile
55 lines (39 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM debian:latest
LABEL maintainer="Glenn Y. Rolland <glenux@glenux.net>"
LABEL contributors="Dmitrii Zolotov <dzolotov@herzen.spb.ru>"
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
# Install supervisor for managing services
RUN apt-get install -q -y supervisor cron openssh-server pwgen reprepro screen vim-tiny nginx
# Configure cron
# Install cron for managing regular tasks
RUN sed -i 's/\(session *required *pam_loginuid.so\)/#\1/' /etc/pam.d/cron
# Install ssh (run/stop to create required directories)
RUN mkdir /var/run/sshd
#RUN service ssh start ; sleep 1
RUN service ssh stop
# Configure reprepro
ADD scripts/reprepro-import.sh /usr/local/sbin/reprepro-import
RUN chmod 755 /usr/local/sbin/reprepro-import
RUN mkdir -p /var/lib/reprepro/conf
ADD configs/reprepro-distributions /var/lib/reprepro/conf/distributions
# Configure nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm -f /etc/nginx/sites-enabled/default
ADD configs/nginx-default.conf /etc/nginx/sites-enabled/default
# Setup root access
RUN echo "root:docker" | chpasswd
# Configure supervisor
RUN service supervisor stop
ADD configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD configs/supervisor-cron.conf /etc/supervisor/conf.d/cron.conf
ADD configs/supervisor-ssh.conf /etc/supervisor/conf.d/ssh.conf
ADD configs/supervisor-nginx.conf /etc/supervisor/conf.d/nginx.conf
# Finalize
ENV DEBIAN_FRONTEND newt
ADD scripts/start.sh /usr/local/sbin/start
RUN chmod 755 /usr/local/sbin/start
VOLUME ["/docker/keys", "/docker/incoming", "/repository"]
EXPOSE 80
EXPOSE 22
CMD ["/usr/local/sbin/start"]