Browse Source

added camotion-pifaceo

tags/v1.0.0
Robin Thoni 6 years ago
parent
commit
b46af6d6c7
3 changed files with 20 additions and 2 deletions
  1. 12
    0
      backend/Dockerfile
  2. 7
    1
      docker-compose.yml
  3. 1
    1
      env

+ 12
- 0
backend/Dockerfile View File

4
 MAINTAINER Robin Thoni <robin@rthoni.com>
4
 MAINTAINER Robin Thoni <robin@rthoni.com>
5
 
5
 
6
 ARG CONFIG_DIR=/etc/default/config-files/
6
 ARG CONFIG_DIR=/etc/default/config-files/
7
+ARG SPI_USER_UID=999
7
 
8
 
8
 RUN apt-get update && apt-get -y install\
9
 RUN apt-get update && apt-get -y install\
9
         curl\
10
         curl\
11
+        make\
12
+        build-essential\
13
+        gcc\
10
         git\
14
         git\
11
         unzip\
15
         unzip\
12
         apache2=2.4.*\
16
         apache2=2.4.*\
37
 
41
 
38
 RUN cd /var/www/html && composer install
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
 COPY env "${CONFIG_DIR}"
52
 COPY env "${CONFIG_DIR}"
41
 
53
 
42
 RUN chmod -R 777 /var/www/html/storage/
54
 RUN chmod -R 777 /var/www/html/storage/

+ 7
- 1
docker-compose.yml View File

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

+ 1
- 1
env View File

1
-CM_BACKEND_TOKEN=ed249efcda48a07071e2a341fef8759f1bfafeae
1
+CM_BACKEND_TOKEN=change_it

Loading…
Cancel
Save