瀏覽代碼

added camotion-pifaceo

tags/v1.0.0
Robin Thoni 7 年之前
父節點
當前提交
b46af6d6c7
共有 3 個檔案被更改,包括 20 行新增2 行删除
  1. 12
    0
      backend/Dockerfile
  2. 7
    1
      docker-compose.yml
  3. 1
    1
      env

+ 12
- 0
backend/Dockerfile 查看文件

@@ -4,9 +4,13 @@ FROM robinthoni/debian-multiarch:jessie
4 4
 MAINTAINER Robin Thoni <robin@rthoni.com>
5 5
 
6 6
 ARG CONFIG_DIR=/etc/default/config-files/
7
+ARG SPI_USER_UID=999
7 8
 
8 9
 RUN apt-get update && apt-get -y install\
9 10
         curl\
11
+        make\
12
+        build-essential\
13
+        gcc\
10 14
         git\
11 15
         unzip\
12 16
         apache2=2.4.*\
@@ -37,6 +41,14 @@ COPY ./backend/ /var/www/html/
37 41
 
38 42
 RUN cd /var/www/html && composer install
39 43
 
44
+RUN cd /tmp && git clone https://github.com/piface/libmcp23s17 && cd libmcp23s17 && make && make install && cd / && rm /tmp/libmcp23s17 -rf
45
+
46
+RUN cd /tmp && git clone https://github.com/piface/libpifacedigital && cd libpifacedigital && make && make install && cd / && rm /tmp/libpifacedigital -rf
47
+
48
+RUN cd /tmp && git clone https://git.rthoni.com/camotion/piface && cd piface && make && make install && cd / && rm /tmp/piface -rf
49
+
50
+RUN groupadd -g "${SPI_USER_UID}" spi && usermod -a -G spi www-data
51
+
40 52
 COPY env "${CONFIG_DIR}"
41 53
 
42 54
 RUN chmod -R 777 /var/www/html/storage/

+ 7
- 1
docker-compose.yml 查看文件

@@ -17,15 +17,21 @@ services:
17 17
 #            - env
18 18
 
19 19
     backend:
20
-        build: ./backend
20
+        build:
21
+            context: ./backend
22
+            args:
23
+                SPI_USER_UID: 999
21 24
         container_name: backend-camotion
22 25
 #        restart: unless-stopped
26
+#        devices:
27
+#            - "/dev/spidev0.0:/dev/spidev0.0"
23 28
         networks:
24 29
             camotion.internal.docker:
25 30
                 aliases:
26 31
                     - backend.camotion.internal.docker
27 32
         ports:
28 33
             - "127.0.0.1:35001:80"
34
+            - "4242:80"
29 35
         env_file:
30 36
             - env
31 37
 

+ 1
- 1
env 查看文件

@@ -1 +1 @@
1
-CM_BACKEND_TOKEN=ed249efcda48a07071e2a341fef8759f1bfafeae
1
+CM_BACKEND_TOKEN=change_it

Loading…
取消
儲存