-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Dockerfile
34 lines (27 loc) · 908 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
FROM python:3.11-slim
ARG USER=fauxmo
ARG HOME=/home/${USER}
ARG VENV=${HOME}/.venv
ARG PYTHON=${VENV}/bin/python3
ARG UID=${FAUXMO_UID:-10000}
ARG GID=${FAUXMO_GID:-10000}
RUN apt-get update \
&& apt-get install -y python3-uvloop \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup --gid "${GID}" "${USER}" \
&& useradd \
--shell /usr/sbin/nologin \
--uid "${UID}" \
--gid "${USER}" \
"${USER}"
COPY --chown=${USER} pyproject.toml README.md CHANGELOG.md /app/
COPY --chown=${USER} src/ /app/src
COPY --chown=${USER} tests/ /app/tests
COPY --chown=${USER} config-sample.json /home/${USER}/.fauxmo/config-sample.json
USER ${USER}
WORKDIR ${HOME}
RUN python3 -m venv --system-site-packages "${VENV}" \
&& "${PYTHON}" -m pip install --upgrade pip \
&& "${PYTHON}" -m pip install /app[test]
ENV FAUXMO_PYTHON ${PYTHON}
CMD ${FAUXMO_PYTHON} -m fauxmo.cli -vvv