Matthias Kleine 9 年 前
コミット
16b845405f
共有6 個のファイルを変更した67 個の追加7 個の削除を含む
  1. 3 1
      .gitignore
  2. 25 0
      docker-compose.yml
  3. 9 4
      fhem/Dockerfile
  4. 24 1
      homebridge/Dockerfile
  5. 1 1
      homebridge/config.json
  6. 5 0
      homebridge/start.sh

+ 3 - 1
.gitignore

@@ -1,2 +1,4 @@
 .DS_Store
-.idea
+.idea
+!.gitkeep
+/fhem/log/*

+ 25 - 0
docker-compose.yml

@@ -7,12 +7,37 @@ services:
         ports:
             - "8083:8083"
         build: fhem
+        privileged: true
+        devices:
+          - "/dev/ttyUSB0:/dev/ttyUSB0"
 #        volumes:
 #            - ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
 #            - ./es_data:/usr/share/elasticsearch/data
         networks:
             - code-network
 
+    homebridge:
+        expose:
+            - "51826"
+        ports:
+            - "51826:51826"
+        build: homebridge
+        networks:
+            - code-network
+
+    mysql:
+        expose:
+            - "3306"
+            - "33060"
+        ports:
+            - "3306:3306"
+            - "33060:33060"
+        image: mysql/mysql-server:5.7
+        environment:
+            - MYSQL_ROOT_PASSWORD=fhemlog
+        networks:
+            - code-network
+
 networks:
     code-network:
         driver: bridge

+ 9 - 4
fhem/Dockerfile

@@ -6,8 +6,8 @@ ENV DEBIAN_FRONTEND noninteractive
 ENV TERM xterm
 
 # Install dependencies
-RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
-RUN apt-get -y --force-yes install perl wget git nano make gcc g++ apt-transport-https libavahi-compat-libdnssd-dev sudo nodejs etherwake
+RUN apt-get update && apt-get upgrade -y --force-yes && apt-get install -y --force-yes --no-install-recommends apt-utils
+RUN apt-get -y --force-yes install perl wget git apt-transport-https libavahi-compat-libdnssd-dev sudo nodejs etherwake
 
 # Install perl packages
 RUN apt-get -y --force-yes install libalgorithm-merge-perl \
@@ -35,7 +35,12 @@ libxml-simple-perl
 RUN wget -qO - https://debian.fhem.de/archive.key | apt-key add -
 RUN echo "deb https://debian.fhem.de/stable ./" | tee -a /etc/apt/sources.list.d/fhem.list
 RUN apt-get update
-RUN apt-get -y --force-yes install supervisor fhem telnet
-RUN mkdir -p /var/log/supervisor
+RUN apt-get -y --force-yes install fhem telnet
 
 RUN echo Europe/Berlin > /etc/timezone && dpkg-reconfigure tzdata
+
+RUN chown fhem /opt/fhem/fhem.cfg
+
+VOLUME ["/opt/fhem"]
+
+EXPOSE 8083

+ 24 - 1
homebridge/Dockerfile

@@ -1,4 +1,27 @@
 FROM debian:jessie
 
-MAINTAINER dominikauer <dobsiin@gmail.com>
+MAINTAINER Matthias Kleine <info@haus-automatisierung.com>
 
+ENV DEBIAN_FRONTEND noninteractive
+ENV TERM xterm
+
+# Install dependencies
+RUN apt-get update && apt-get upgrade -y --force-yes && apt-get install -y --force-yes --no-install-recommends apt-utils
+RUN apt-get install -y --force-yes xz-utils wget python libavahi-compat-libdnssd-dev
+
+RUN echo Europe/Vienna > /etc/timezone && dpkg-reconfigure tzdata
+
+RUN wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz -P /tmp && cd /usr/local && tar -xvf /tmp/node-v6.9.2-linux-x64.tar.xz --strip=1
+RUN ln -s /usr/local/bin/node /usr/bin/node
+
+ENV NODE_ENV production
+
+RUN apt-get install -y --force-yes make make gcc g++
+
+RUN npm install -g homebridge homebridge-fhem homebridge-http
+
+EXPOSE 51826
+
+COPY start.sh ./
+RUN chmod +x ./start.sh
+CMD ["./start.sh"]

+ 1 - 1
homebridge/config.json

@@ -17,4 +17,4 @@
      ],
 
     "accessories": []
-}
+}

+ 5 - 0
homebridge/start.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+
+/etc/init.d/dbus restart
+service avahi-daemon start
+homebridge