Skip to content

Commit

Permalink
docker: run orchids container introduced
Browse files Browse the repository at this point in the history
  • Loading branch information
fernflower committed Sep 25, 2017
1 parent 981e39c commit d68d04e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 1 deletion.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Pull base image
FROM resin/rpi-raspbian:wheezy

COPY . /savemyorchids

# Install dependencies
RUN apt-get update && apt-get install -y \
git \
build-essential \
python \
python-dev \
python-pip \
python-virtualenv \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/* && \
chmod +x /savemyorchids/entrypoint.sh && \
virtualenv -p /usr/bin/python2.7 /venv && \
# this is a workaround to install python-daemon without errors
/venv/bin/pip install docutils && \
git clone https://github.com/adafruit/Adafruit_Python_DHT && \
cd Adafruit_Python_DHT && /venv/bin/python setup.py install && \
/venv/bin/pip install -r /savemyorchids/requirements.txt

# Define working directory
WORKDIR /savemyorchids

ENTRYPOINT ["/savemyorchids/entrypoint.sh"]

# Define default command
CMD ["bash"]
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

/venv/bin/python /savemyorchids/run.py
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
argparse
influxdb
python-daemon
RPi.GPIO
8 changes: 8 additions & 0 deletions run_docker_orchids.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

IMAGE=savemyorchids
SERVICE_NAME=orchids

sudo docker build -t $IMAGE .
# privileged flag has to be there for gpio management
sudo docker run -i --privileged --name $SERVICE_NAME $IMAGE

0 comments on commit d68d04e

Please sign in to comment.