-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
35 lines (28 loc) · 780 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.9-slim-buster
LABEL maintainer="Martin Jones <whatdaybob@outlook.com>"
# Copy and install requirements
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
# create abc user so root isn't used
RUN \
groupmod -g 1000 users && \
useradd -u 911 -U -d /config -s /bin/false abc && \
usermod -G users abc && \
# create some files / folders
mkdir -p /config /app && \
touch /var/lock/tado_guestmode.lock
# add volumes
VOLUME /config
# Add tado_guestmode app
COPY app/ /app
WORKDIR /app
# update file permissions
RUN \
chmod a+x \
/app/tado_guestmode.py \
/app/rest.py \
/app/utils.py \
/app/config.yml.template
# ENV setup
ENV CONFIGPATH /config/config.yml
CMD ["gunicorn", "-b", "0.0.0.0:80", "rest:app", "-w", "5"]