Skip to content

Commit

Permalink
removed supervisord, using baseimage-docker init system. added automa…
Browse files Browse the repository at this point in the history
…tic port updates.
  • Loading branch information
haugene committed Nov 11, 2014
1 parent 1154a0f commit 269cba4
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 16 deletions.
26 changes: 17 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,32 @@ RUN apt-get update
RUN apt-get install -y transmission-cli
RUN apt-get install -y transmission-common
RUN apt-get install -y transmission-daemon
RUN apt-get install -y supervisor
RUN apt-get install -y openvpn
RUN apt-get install -y curl
RUN apt-get install -y screen

# Create directories
RUN mkdir -p /var/log/supervisor
# Transmission service
RUN mkdir -p /etc/service/transmission/
ADD transmission/run.sh /etc/service/transmission/run

# Transmission port updater
RUN mkdir -p /etc/service/portupdater/
ADD transmission/runUpdates.sh /etc/service/portupdater/run

# OpenVPN service
RUN mkdir -p /etc/service/openvpn/
ADD runOpenVpn.sh /etc/service/openvpn/run

# Add configuration and scripts
ADD piaconfig/config.ovpn /etc/openvpn/config.ovpn
ADD piaconfig/credentials.txt /etc/openvpn/credentials.txt
ADD piaconfig/ca.crt /etc/openvpn/ca.crt
ADD piaconfig/crl.pem /etc/openvpn/crl.pem
ADD startOpenVPN.sh /etc/openvpn/start.sh
ADD transmissionSettings.json /etc/transmission-daemon/settings.json
ADD updateTransmissionPort.sh /etc/transmission-daemon/updatePort.sh
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD runOpenVpn.sh /etc/openvpn/start.sh
ADD transmission/transmissionSettings.json /etc/transmission-daemon/settings.json
ADD transmission/updateTransmissionPort.sh /etc/transmission-daemon/updatePort.sh
ADD transmission/periodicUpdates.sh /etc/transmission-daemon/periodicUpdates.sh

# Expose port and run supervisord
# Expose port and run. Use baseimage-docker's init system
EXPOSE 9091
CMD ["/usr/bin/supervisord"]
CMD ["/sbin/my_init"]
6 changes: 3 additions & 3 deletions piaconfig/config.ovpn
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
ca /etc/openvpn/ca.crt
tls-client
remote-cert-tls server
auth-user-pass credentials.txt
auth-user-pass /etc/openvpn/credentials.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify crl.pem
crl-verify /etc/openvpn/crl.pem


3 changes: 3 additions & 0 deletions runOpenVpn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec openvpn --config /etc/openvpn/config.ovpn
4 changes: 0 additions & 4 deletions startOpenVPN.sh

This file was deleted.

8 changes: 8 additions & 0 deletions transmission/periodicUpdates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

while [ 1 ]
do
sleep 1m
/etc/transmission-daemon/updatePort.sh
sleep 1m
done
2 changes: 2 additions & 0 deletions transmission/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/transmission-daemon -f -g /etc/transmission-daemon/
3 changes: 3 additions & 0 deletions transmission/runUpdates.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec /etc/transmission-daemon/periodicUpdates.sh
File renamed without changes.
File renamed without changes.

0 comments on commit 269cba4

Please sign in to comment.