From 44fe425b5e533bb31597ac04c527f395af399739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ja=C5=A1a=20Bartelj?= Date: Sat, 23 Jan 2021 15:11:36 +0100 Subject: [PATCH] add Dockerfile Use latest slim python as base, create limited user, add code to wd, install deps and show help by default but override the command at runtime. Build command: ```bash docker build -t huami_token:`git describe` . ``` Run command: ```bash docker run --rm -it huami_token:`git describe` -m xiaomi -b ``` --- Dockerfile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..801bc13 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:slim +RUN useradd -U -m -d /app freedom +USER freedom +WORKDIR /app +ADD --chown=freedom:freedom . . +RUN pip install -r requirements.txt +ENTRYPOINT ["python", "/app/huami_token.py"] +CMD ["--help"]