Revision 740fa994

View differences:

Dockerfile
1
# http://phusion.github.io/baseimage-docker/
2
FROM phusion/baseimage:0.9.22
1
FROM debian:stable-slim
2
MAINTAINER Luca Baldesi <luca.baldesi@unitn.it>
3 3

  
4
# Use baseimage-docker's init system.
5
CMD ["/sbin/my_init"]
4
# Install supervisord and automatic upgrade stuff
5
RUN apt-get update \
6
 && apt-get install -y supervisor unattended-upgrades cron \
7
 && rm -rf /var/lib/apt/lists/*
6 8

  
7 9
# Set /peerstreamer as working directory
8 10
WORKDIR /peerstreamer
......
29 31
RUN rm -rf /peerstreamer/serf-python
30 32

  
31 33
# Build peerstreamer
32
RUN git clone -b webrtp \
34
RUN git clone -b devel \
33 35
        https://ans.disi.unitn.it/redmine/peerstreamer-src.git \
34 36
            peerstreamer
35 37
RUN cd /peerstreamer/peerstreamer && make
......
38 40
RUN git clone \
39 41
        https://ans.disi.unitn.it/redmine/psng-pyserf.git \
40 42
            psng-pyserf
43
RUN chmod +x psng-pyserf/psng-pyserf.py
41 44

  
42 45
RUN apt remove -y git automake \
43 46
        && apt autoremove -y
44 47

  
45
# Create script for running psng-pyserf service
46
RUN mkdir /etc/service/psng-pyserf
47
ADD psng-pyserf.sh /etc/service/psng-pyserf/run
48

  
49
# Create script for running peerstreamer
50
RUN mkdir /etc/service/peerstreamer
51
ADD peerstreamer.sh /etc/service/peerstreamer/run
52

  
53 48
# Clean up APT when done.
54 49
RUN apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
50

  
51
COPY supervisord.conf /etc/supervisor/supervisord.conf
52
COPY cron-supervisord.conf /etc/supervisor/conf.d/cron.conf
53
COPY psng-supervisord.conf /etc/supervisor/conf.d/psng.conf
54
COPY pyserf-supervisord.conf /etc/supervisor/conf.d/pyserf.conf
55

  
56
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
cron-supervisord.conf
1
[program:cron]
2
priority=20
3
directory=/tmp
4
command=/usr/sbin/cron -f
5
user=root
6
autostart=true
7
autorestart=true
8
stdout_logfile=/var/log/supervisor/%(program_name)s.log
9
stderr_logfile=/var/log/supervisor/%(program_name)s.log
peerstreamer.sh
1
#!/bin/sh
2

  
3
cd /peerstreamer/peerstreamer
4
./peerstreamer-ng -c /tmp/channels.db > /dev/null 2>&1
psng-pyserf.sh
1
#!/bin/sh
2

  
3
python /peerstreamer/psng-pyserf/psng-pyserf.py -t psngc -a 127.0.0.1 -p 7373 \
4
    bg /tmp/channels.db > /dev/null 2>&1
psng-supervisord.conf
1
[program:psng]
2
priority=20
3
directory=/peerstreamer/peerstreamer/
4
command=/peerstreamer/peerstreamer/peerstreamer-ng -c /tmp/channels.db 
5
user=root
6
autostart=true
7
autorestart=true
8
stdout_logfile=/var/log/supervisor/%(program_name)s.log
9
stderr_logfile=/var/log/supervisor/%(program_name)s.log
10

  
pyserf-supervisord.conf
1
[program:pyserf]
2
priority=20
3
directory=/peerstreamer/psng-pyserf/
4
command=/peerstreamer/psng-pyserf/psng-pyserf.py -t psngc -a 127.0.0.1 -p 7373 bg /tmp/channels.db 
5
user=root
6
autostart=true
7
autorestart=true
8
stdout_logfile=/var/log/supervisor/%(program_name)s.log
9
stderr_logfile=/var/log/supervisor/%(program_name)s.log
10

  
supervisord.conf
1
; supervisor config file
2
[supervisord]
3
nodaemon=true
4
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
5
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
6
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)
7

  
8
; The [include] section can just contain the "files" setting.  This
9
; setting can list multiple files (separated by whitespace or
10
; newlines).  It can also contain wildcards.  The filenames are
11
; interpreted as relative to this file.  Included files *cannot*
12
; include files themselves.
13

  
14
[include]
15
files = /etc/supervisor/conf.d/*.conf

Also available in: Unified diff