-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: run orchids container introduced
- Loading branch information
1 parent
981e39c
commit d68d04e
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
/venv/bin/python /savemyorchids/run.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
argparse | ||
influxdb | ||
python-daemon | ||
RPi.GPIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |