From c38b165051c12b0ba85496629e30ceb76b11677a Mon Sep 17 00:00:00 2001 From: Patrick McDonagh Date: Mon, 8 May 2017 11:52:02 -0500 Subject: [PATCH] Fixes RPi docker files and adds RPi docker compose file --- daq/Dockerfile | 4 ---- daq/Dockerfile.rpi | 13 +++++++------ daq/Dockerfile.ubuntu | 8 +++----- docker-compose-rpi.yml | 23 +++++++++++++++++++++++ web_db/Dockerfile | 2 +- web_db/Dockerfile.rpi | 6 ++++-- web_db/Dockerfile.ubuntu | 2 +- 7 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 docker-compose-rpi.yml diff --git a/daq/Dockerfile b/daq/Dockerfile index 60459f1..3e468d9 100644 --- a/daq/Dockerfile +++ b/daq/Dockerfile @@ -3,14 +3,10 @@ FROM python:latest # Copy source files RUN mkdir /root/tag-logger COPY taglogger.py /root/tag-logger/taglogger.py -# COPY pycomm-master /tmp/pycomm -# COPY Pycomm-Helper /tmp/pycomm_helper # Install some python packages RUN pip install requests RUN pip install git+https://github.com/Henry-Pump/Pycomm-Helper.git RUN pip install git+https://github.com/ruscito/pycomm.git -RUN cd /tmp/pycomm && python setup.py install && cd / -RUN cd /tmp/pycomm_helper && python setup.py install && cd / CMD ["python", "/root/tag-logger/taglogger.py"] diff --git a/daq/Dockerfile.rpi b/daq/Dockerfile.rpi index e50661d..a0e0fd3 100644 --- a/daq/Dockerfile.rpi +++ b/daq/Dockerfile.rpi @@ -1,14 +1,15 @@ -FROM patrickjmcd/rpi-python3:latest +FROM armv7/armhf-ubuntu -# Copy source files +# Copy source files RUN mkdir /root/tag-logger COPY taglogger.py /root/tag-logger/taglogger.py -COPY pycomm-master /tmp/pycomm -COPY pycomm_helper /tmp/pycomm_helper +RUN apt-get update && apt-get install -y python python-pip git +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Install some python packages +RUN pip install --upgrade pip RUN pip install requests -RUN cd /tmp/pycomm && python setup.py install && cd / -RUN cd /tmp/pycomm_helper && python setup.py install && cd / +RUN pip install git+https://github.com/Henry-Pump/Pycomm-Helper.git +RUN pip install git+https://github.com/ruscito/pycomm.git CMD ["python", "/root/tag-logger/taglogger.py"] diff --git a/daq/Dockerfile.ubuntu b/daq/Dockerfile.ubuntu index e381d86..3e468d9 100644 --- a/daq/Dockerfile.ubuntu +++ b/daq/Dockerfile.ubuntu @@ -1,14 +1,12 @@ FROM python:latest -# Copy source files +# Copy source files RUN mkdir /root/tag-logger COPY taglogger.py /root/tag-logger/taglogger.py -COPY pycomm-master /tmp/pycomm -COPY pycomm_helper /tmp/pycomm_helper # Install some python packages RUN pip install requests -RUN cd /tmp/pycomm && python setup.py install && cd / -RUN cd /tmp/pycomm_helper && python setup.py install && cd / +RUN pip install git+https://github.com/Henry-Pump/Pycomm-Helper.git +RUN pip install git+https://github.com/ruscito/pycomm.git CMD ["python", "/root/tag-logger/taglogger.py"] diff --git a/docker-compose-rpi.yml b/docker-compose-rpi.yml new file mode 100644 index 0000000..593bba5 --- /dev/null +++ b/docker-compose-rpi.yml @@ -0,0 +1,23 @@ +version : '2' +services: + web_db: + image: docker.henrypump.cloud/datalogger/rpi-web_db + ports: + - "443:5000" + daq: + image: docker.henrypump.cloud/datalogger/rpi-daq + depends_on: + - web_db + links: + - web_db + + +# networks: +# poconsole: +# driver: bridge +# driver_opts: +# com.docker.network.enable_ipv4: "true" +# ipam: +# driver: default +# config: +# - subnet: 10.10.10.0/24 diff --git a/web_db/Dockerfile b/web_db/Dockerfile index 56dfefb..bbf1982 100644 --- a/web_db/Dockerfile +++ b/web_db/Dockerfile @@ -20,4 +20,4 @@ RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN service mysql restart && python /root/tag-logger/flask/setupdb.py -CMD '/root/startup.sh' +CMD ["/root/startup.sh"] diff --git a/web_db/Dockerfile.rpi b/web_db/Dockerfile.rpi index 95c6a6e..8a23b08 100644 --- a/web_db/Dockerfile.rpi +++ b/web_db/Dockerfile.rpi @@ -1,8 +1,10 @@ -FROM patrickjmcd/rpi-python3:latest +FROM armv7/armhf-ubuntu RUN apt-get -y update COPY mysql-install.sh /tmp/mysql-install.sh RUN chmod +x /tmp/mysql-install.sh && /tmp/mysql-install.sh +RUN apt-get install -y python python-pip git libffi-dev libssl-dev +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN mkdir /root/tag-logger COPY flask /root/tag-logger/flask @@ -20,4 +22,4 @@ RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN service mysql restart && python /root/tag-logger/flask/setupdb.py -CMD '/root/startup.sh' +CMD ["/root/startup.sh"] diff --git a/web_db/Dockerfile.ubuntu b/web_db/Dockerfile.ubuntu index 56dfefb..bbf1982 100644 --- a/web_db/Dockerfile.ubuntu +++ b/web_db/Dockerfile.ubuntu @@ -20,4 +20,4 @@ RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN service mysql restart && python /root/tag-logger/flask/setupdb.py -CMD '/root/startup.sh' +CMD ["/root/startup.sh"]