-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM python:3.7.9 | ||
|
||
# based on https://github.com/pfichtner/docker-mqttwarn | ||
|
||
# install python libraries | ||
#RUN pip install -r requirements.txt | ||
|
||
RUN mkdir -p /opt/psmqtt | ||
WORKDIR /opt/psmqtt | ||
RUN mkdir -p /var/log/psmqtt | ||
|
||
COPY ./requirements.txt /opt/psmqtt | ||
RUN pip install -r /opt/psmqtt/requirements.txt | ||
|
||
# add user psmqtt to image | ||
RUN groupadd -r psmqtt && useradd -r -g psmqtt psmqtt | ||
RUN chown -R psmqtt:psmqtt /opt/psmqtt | ||
RUN chown -R psmqtt:psmqtt /var/log/psmqtt | ||
#RUN chown -R psmqtt /home/psmqtt | ||
|
||
# process run as psmqtt user | ||
USER psmqtt | ||
|
||
# conf file from host | ||
VOLUME ["/opt/psmqtt/conf"] | ||
|
||
# set conf path | ||
ENV PSMQTTCONFIG="/opt/psmqtt/conf/psmqtt.conf" | ||
|
||
# finally, copy the current code (ideally we'd copy only what we need, but it | ||
# is not clear what that is, yet) | ||
COPY . /opt/psmqtt | ||
|
||
# run process | ||
CMD python psmqtt.py |