diff --git a/docker-compose.yml b/docker-compose.yml index 46125df..723ac79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,9 @@ +radio: + build: ./radio + command: supervisord -n -c /etc/supervisord.conf + ports: + - "8999:8999" + rabbitmq: image: tutum/rabbitmq environment: diff --git a/nginx/sites-enabled/deepsouthsounds.com b/nginx/sites-enabled/deepsouthsounds.com index 2cad0f1..9503521 100644 --- a/nginx/sites-enabled/deepsouthsounds.com +++ b/nginx/sites-enabled/deepsouthsounds.com @@ -1,3 +1,15 @@ +server { + listen 80; + server_name radio.deepsouthsounds.com; + + location / { + proxy_pass http://radio:8351; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +} + server { listen 80; server_name api.deepsouthsounds.com api-test.deepsouthsounds.com; diff --git a/radio/Dockerfile b/radio/Dockerfile new file mode 100644 index 0000000..ba63119 --- /dev/null +++ b/radio/Dockerfile @@ -0,0 +1,14 @@ +FROM ubuntu:wily +MAINTAINER Fergal Moran "Ferg@lMoran.me" +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get -qq -y update && \ + apt-get -qq -y install icecast2 python-setuptools && \ + apt-get clean + +RUN easy_install supervisor && \ + easy_install supervisor-stdout + +ADD icecast2/icecast.xml /etc/icecast2/ +ADD default/icecast2 /etc/default/ +ADD supervisord.conf /etc/supervisord.conf diff --git a/radio/default/icecast2 b/radio/default/icecast2 new file mode 100644 index 0000000..3a2521f --- /dev/null +++ b/radio/default/icecast2 @@ -0,0 +1,19 @@ +# Defaults for icecast2 initscript +# sourced by /etc/init.d/icecast2 +# installed at /etc/default/icecast2 by the maintainer scripts + +# +# This is a POSIX shell fragment +# + +# Full path to the server configuration file +CONFIGFILE="/etc/icecast2/icecast.xml" + +# Name or ID of the user and group the daemon should run under +USERID=icecast2 +GROUPID=icecast + +# Edit /etc/icecast2/icecast.xml and change at least the passwords. +# Change this to true when done to enable the init.d script +ENABLE=true + diff --git a/radio/icecast2/icecast.xml b/radio/icecast2/icecast.xml new file mode 100755 index 0000000..b13de92 --- /dev/null +++ b/radio/icecast2/icecast.xml @@ -0,0 +1,51 @@ + + Cork Like + icemaster@deepsouthsounds.com + + + 100 + 2 + 5 + 524288 + 30 + 15 + 10 + 1 + 65535 + + + + RDzNlgqmj67vk + 9PmUbI1mLne9o + + admin + CrVuP5evoJZ0. + + + radio.deepsouthsounds.com + + + 8351 + /dss + + 1 + + + /usr/share/icecast2 + /var/log/icecast2 + /usr/share/icecast2/web + /usr/share/icecast2/admin + + + + + access.log + error.log + 3 + 10000 + + + + 0 + + diff --git a/radio/supervisord.conf b/radio/supervisord.conf new file mode 100644 index 0000000..be7c901 --- /dev/null +++ b/radio/supervisord.conf @@ -0,0 +1,33 @@ +[unix_http_server] +file=/tmp/supervisor.sock + +[supervisord] +logfile=/tmp/supervisord.log +logfile_maxbytes=50MB +logfile_backups=10 +loglevel=info +pidfile=/tmp/supervisord.pid +nodaemon=false +minfds=1024 +minprocs=200 +user=icecast2 + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///tmp/supervisor.sock + +[program:icecast2] +user=icecast2 +command=icecast2 -n -c /etc/icecast2/icecast.xml +stopsignal=6 +stdout_events_enabled=true +stderr_events_enabled=true +autorestart=true + +[eventlistener:stdout] +command=supervisor_stdout +buffer_size=100 +events=PROCESS_LOG +result_hander=supervisor_stdout:event_handler