-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (21 loc) · 839 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
# Alpine for smaller size
FROM python:3.9-alpine
# Create a system account hubitile.hubitile
RUN addgroup -S hubitile && adduser -S hubitile -G hubitile
# Non-alpine equivalent of above:
#RUN groupadd -r hubitile && useradd -r -m -g hubitile hubitile
USER hubitile
WORKDIR /app
# set environment variables
# PYTHONDONTWRITEBYTECODE: Prevents Python from writing pyc files to disc
# PYTHONUNBUFFERED: Prevents Python from buffering stdout and stderr
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Install location of upgraded pip
ENV PATH /home/hubitile/.local/bin:$PATH
COPY requirements.txt /app
RUN pip install --no-cache-dir --disable-pip-version-check --upgrade pip && \
pip install --no-cache-dir -r ./requirements.txt
COPY *.py /app/
COPY template.config.yaml /app/
ENTRYPOINT python main.py