diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73ca3f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM arm32v7/ubuntu:latest +MAINTAINER Maik Schwan + +#Install libpcap-dev +RUN apt-get -y update && \ + apt-get -y upgrade && \ + apt-get install -y nodejs && \ + apt-get install -y npm && \ + apt-get install -y git && \ + apt-get install -y wget && \ + apt-get install -y libpcap-dev + +#update node +RUN wget http://node-arm.herokuapp.com/node_latest_armhf.deb +RUN dpkg -i node_latest_armhf.deb + +#install dasher +RUN cd /root && export GIT_SSL_NO_VERIFY=1 && \ + git config --global http.sslVerify false && \ + git clone https://github.com/maddox/dasher.git + +WORKDIR /root/dasher +RUN cd /root/dasher && npm install + +# Interface the environment +VOLUME /root/dasher/config + +# Baseimage init process +CMD cd /root/dasher && npm run start diff --git a/README.md b/README.md index ef67b37..f72c52c 100755 --- a/README.md +++ b/README.md @@ -203,10 +203,45 @@ Starting from a fresh Raspberry Pi Build? # update /config/config.json with mac address of your button sudo npm run start +#### Docker +You can run dasher inside a docker container: + + # pull the image + docker pull nesurion/dasher + # start the container + docker run --rm --name dasher --volume :/root/dasher/config --net host nesurion/dasher + **Auto Starting** Advanced information on autostarting Dasher on your Raspberry Pi can be found [here](https://github.com/maddox/dasher/wiki/Running-Dasher-on-a-Raspberry-Pi-at-startup). +**Auto Starting using Docker with systemd** + +Create a new service by creating a new file /etc/systemd/system/dasher.service + + [Unit] + Description=Dasher + After=docker.service + Requires=docker.service + + [Service] + ExecStartPre=-/usr/bin/docker stop dasher + ExecStartPre=-/usr/bin/docker rm dasher + After=docker.service + ExecStartPre=-/usr/bin/docker pull nesuion/dasher + ExecStart=/usr/bin/docker run --rm --name dasher --volume /home/pi/dasher/config:/root/dasher/config --net host dasher + ExecStop=/usr/bin/docker stop dasher + Restart=on-failure + RestartSec=10 + + [Install] + WantedBy=multi-user.target + +Add the new service to systemd: + + sudo systemctl enable dasher.service + + ## Contributions * fork