dirkse 8 rokov pred
rodič
commit
b678cb142f
3 zmenil súbory, kde vykonal 96 pridanie a 1 odobranie
  1. 1 1
      autocli.yml
  2. 73 0
      jupyter/Dockerfile
  3. 22 0
      services.yml

+ 1 - 1
autocli.yml

@@ -1,7 +1,7 @@
 auto_reload: 1
 confirm_quit: false
 
-modules: [auto.lib.docker, auto.lib.infrastructure]
+modules: [auto.lib.docker_base, auto.lib.infrastructure]
 letsencrypt_email: thecere@gmail.com
 
 path:

+ 73 - 0
jupyter/Dockerfile

@@ -0,0 +1,73 @@
+# This file creates a container that runs a jupyter notebook server on Raspberry Pi
+#
+# Author: Max Jiang
+# Date 13/02/2017
+
+FROM resin/rpi-raspbian:jessie
+MAINTAINER Max Jiang <maxjiang@hotmail.com>
+
+# Set the variables
+ENV DEBIAN_FRONTEND noninteractive
+ENV PHTHON_VERSION 3.6.0
+
+WORKDIR /root
+
+# Install packages necessary for compiling python
+RUN apt-get update && apt-get upgrade && apt-get install -y \
+        build-essential \
+        libncursesw5-dev \
+        libgdbm-dev \
+        libc6-dev \
+        zlib1g-dev \
+        libsqlite3-dev \
+        tk-dev \
+        libssl-dev \
+        openssl
+
+# Download and compile python
+RUN apt-get install -y ca-certificates
+ADD "https://www.python.org/ftp/python/${PHTHON_VERSION}/Python-${PHTHON_VERSION}.tgz" /root/Python-${PHTHON_VERSION}.tgz
+RUN tar zxvf "Python-${PHTHON_VERSION}.tgz" \
+        && cd Python-${PHTHON_VERSION} \
+        && ./configure \
+        && make \
+        && make install \
+        && cd .. \
+        && rm -rf "./Python-${PHTHON_VERSION}" \
+        && rm "./Python-${PHTHON_VERSION}.tgz"
+
+# Update pip and install jupyter
+RUN apt-get install -y libncurses5-dev
+RUN pip3 install --upgrade pip
+RUN pip3 install readline jupyter
+
+# Configure jupyter
+# we run this manually after mounting /root/.jupyter
+# RUN jupyter notebook --generate-config
+# RUN mkdir notebooks
+# RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /root/.jupyter/jupyter_notebook_config.py \
+#        && sed -i "/c.NotebookApp.ip/c c.NotebookApp.ip = '*'" /root/.jupyter/jupyter_notebook_config.py \
+#        && sed -i "/c.NotebookApp.notebook_dir/c c.NotebookApp.notebook_dir = '/root/notebooks'" /root/.jupyter/jupyter_notebook_config.py
+
+VOLUME /root/notebooks
+
+# Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes.
+ENV TINI_VERSION 0.14.0
+ENV CFLAGS="-DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37"
+
+ADD https://github.com/krallin/tini/archive/v${TINI_VERSION}.tar.gz /root/v${TINI_VERSION}.tar.gz
+RUN apt-get install -y cmake
+RUN tar zxvf v${TINI_VERSION}.tar.gz \
+        && cd tini-${TINI_VERSION} \
+        && cmake . \
+        && make \
+        && cp tini /usr/bin/. \
+        && cd .. \
+        && rm -rf "./tini-${TINI_VERSION}" \
+        && rm "./v${TINI_VERSION}.tar.gz"
+
+ENTRYPOINT ["/usr/bin/tini", "--"]
+
+EXPOSE 8888
+
+CMD ["jupyter", "notebook"]

+ 22 - 0
services.yml

@@ -1,5 +1,15 @@
 ---
 
+jupyter:
+  host: himbeere
+  docker:
+    build: jupyter
+    ports: 17888:80
+    volumes:
+      - /opt/fast/jupyter/notebooks:/root/notebooks
+      - /opt/fast/jupyter/config:/root/.local
+      - /opt/fast/jupyter/config_root:/root/.jupyter
+
 domoticz:
   host: himbeere
   fqdn: domo.cere.duckdns.org
@@ -98,3 +108,15 @@ gogs:
     ports: 3022:22
     env:
       VIRTUAL_PORT: 3000
+graphite:
+  host: himbeere
+  docker:
+    build: graphite
+    #~ image: abarbanell/docker-grafana-graphite
+    volumes:
+      - /opt/fast/graphite/whisper:/opt/graphite/storage/whisper
+      - /opt/fast/graphite/logs:/var/log/supervisor
+    ports:
+      - 13080:8000
+      - 8125:8125/udp
+      - 8126:8126