Browse Source

first working version

Toastie 4 years ago
parent
commit
7effbb01ca
3 changed files with 21 additions and 4 deletions
  1. 13 3
      rfidac/Dockerfile
  2. 8 0
      rfidac/docker-compose.yml
  3. 0 1
      rfidac/rfid-test.py

+ 13 - 3
rfidac/Dockerfile

@@ -1,5 +1,15 @@
-FROM arm32v6/alpine:edge
+FROM arm32v6/alpine
 
-RUN apk add --no-cache python3 linux-headers \
- && pip install --upgrade pip
+ARG gid_input=105
+
+RUN echo "rfidac:x:100:105:RFIC AC,,,:/opt:/sbin/nologin" >> /etc/passwd \
+ && apk add --no-cache --update python3 \
+ && pip3 install --upgrade pip setuptools \
+ && apk add --no-cache linux-headers gcc musl-dev python3-dev \
  && pip3 install evdev
+
+ADD rfid-test.py /opt/rfid-test.py
+
+USER rfidac
+
+CMD ["/usr/bin/python3","-u","/opt/rfid-test.py"]

+ 8 - 0
rfidac/docker-compose.yml

@@ -0,0 +1,8 @@
+version: '3.3'
+services:
+  rfidac:
+    build: .
+    container_name: rfidac 
+    image: toastie/rfidac
+    devices:
+      - '/dev/input/event0:/dev/input/event0'

+ 0 - 1
rfidac/rfid-test.py

@@ -26,4 +26,3 @@ while True:
     print(rfid)
     last_ts = datetime.now()
     last_rfid = rfid
-    run_action(script)