Skip to content

Commit

Permalink
user + folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Tob1as committed Jan 27, 2023
1 parent 48f1412 commit 725919e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions python.mqtt2sql.alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ SHELL ["/bin/sh", "-euxo", "pipefail", "-c"]
COPY mqtt2sql.py /service/

RUN \
addgroup --gid 1000 service ; \
adduser --system --shell /bin/sh --uid 1000 --ingroup service --home /service service ; \
\
#mkdir /service ; \
apk add --no-cache --virtual .build-deps \
gcc libc-dev \
Expand All @@ -29,10 +32,15 @@ RUN \
pip3 install --no-cache-dir mariadb==1.0.11; \
pip3 install --no-cache-dir paho-mqtt; \
apk del --no-network --purge .build-deps; \
chmod +x /service/*.py
chmod +x /service/*.py ; \
\
mkdir /data ; \
chmod 777 /data ; \
chown -R service:service /data

WORKDIR /service
WORKDIR /data
USER service

STOPSIGNAL SIGINT

CMD ["python3", "-u", "./mqtt2sql.py"]
CMD ["python3", "-u", "/service/mqtt2sql.py"]

0 comments on commit 725919e

Please sign in to comment.