-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
36 lines (24 loc) · 936 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.7-stretch
# based on https://github.com/pfichtner/docker-mqttwarn
# install python libraries (TODO: any others?)
#RUN pip install paho-mqtt requests ConfigParser pycurl
# build /opt/mqttwarn
RUN mkdir -p /opt/cameraevents
WORKDIR /opt/cameraevents
COPY ./requirements.txt /opt/cameraevents
#RUN pip install -r /opt/cameraevents/requirements.txt
RUN python -m pip install -r /opt/cameraevents/requirements.txt
# add user mqttwarn to image
RUN groupadd -r cameraevents && useradd -r -g cameraevents cameraevents
RUN chown -R cameraevents /opt/cameraevents
# process run as mqttwarn user
USER cameraevents
# conf file from host
VOLUME ["/opt/cameraevents/conf"]
# set conf path
ENV CAMERAEVENTSINI="/opt/cameraevents/conf/config.ini"
# finally, copy the current code (ideally we'd copy only what we need, but it
# is not clear what that is, yet)
COPY . /opt/cameraevents
# run process
CMD python CameraEvents.py