diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bc19a48 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:14.04.1 + +RUN apt-get update -y +RUN apt-get install -y python-setuptools python-dev build-essential libffi-dev libssl-dev + +WORKDIR /opt +ADD . /opt/app +WORKDIR /opt/app + +RUN python setup.py build +RUN python setup.py install + +ADD docker/run.sh /opt/run.sh +RUN chmod 777 /opt/run.sh + +EXPOSE 57575 + +CMD ["/opt/run.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 1e1cc68..e4ee1f4 100644 --- a/README.md +++ b/README.md @@ -67,3 +67,16 @@ Run `python dev.py --debug --port=12345` and you are set (yes you can launch it You should have received a copy of the GNU General Public License along with this program. If not, see . ``` + +## Docker Usage +There is a docker repository created for this project that is set to automatically rebuild when there is a push +into this repository: https://registry.hub.docker.com/u/garland/butterfly/ + +### Starting + + docker run \ + --env PASSWORD=password \ + --env PORT=57575 \ + -p 57575:57575 \ + -d garland/butterfly + diff --git a/docker/run.sh b/docker/run.sh new file mode 100644 index 0000000..4b4e7ec --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# Set password +echo "root:${PASSWORD}" | chpasswd + +if [ -z ${PORT} ] +then + echo "Starting on default port: 57575" + /opt/app/butterfly.server.py --unsecure --host=0.0.0.0 +else + echo "Starting on port: ${PORT}" + /opt/app/butterfly.server.py --unsecure --host=0.0.0.0 --port=${PORT} +fi \ No newline at end of file