-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (23 loc) · 1.01 KB
/
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
FROM python:3.8-alpine
MAINTAINER Rafa Muñoz [email protected] (@rafa93m)
RUN set -eux \
&& apk add --update --no-cache dcron libcap \
&& pip install --no-cache-dir pymongo \
&& pip install --no-cache-dir urllib3 \
&& pip install --no-cache-dir pytelegrambotapi \
&& pip install --no-cache-dir mqtthandler \
&& pip install --no-cache-dir dnspython
COPY bot /opt/bot
RUN echo "****** Create user ******" && \
addgroup -g 1000 -S storjnodemonitor && \
adduser -u 1000 -S storjnodemonitor -G storjnodemonitor && \
chown storjnodemonitor:storjnodemonitor /usr/sbin/crond && \
setcap cap_setgid=ep /usr/sbin/crond && \
mkdir /opt/bot/crontab && \
echo "* * * * * python3 /opt/bot/check_nodes.py" > /opt/bot/crontab/storjnodemonitor && \
chown -R storjnodemonitor:storjnodemonitor /opt/bot && \
chmod -R 744 /opt/bot
USER storjnodemonitor
WORKDIR /opt/bot
ENTRYPOINT ["/bin/sh","/opt/bot/docker-entrypoint.sh"]
CMD ["python3","/opt/bot/storjmonitor_bot.py"]