From 0d10e29cf61e834a17752ce71a61f362f0141112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Serba?= Date: Thu, 18 May 2023 08:53:59 +0200 Subject: [PATCH] feat(build): drop root privileges, update .dockerignore --- .dockerignore | 3 +++ Dockerfile | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 767c0c3..c54fa0a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -105,9 +105,12 @@ venv.bak/ # Other stuff .env.example +.dockerignore .gitignore .github/ app.json +Dockerfile +LICENSE Procfile README.md Pipfile diff --git a/Dockerfile b/Dockerfile index 478f697..225e4c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.9-slim as py FROM py as build -RUN apt update && apt install -y g++ +RUN apt-get update && apt-get install -y g++ COPY requirements.txt / RUN pip install --prefix=/inst -U -r /requirements.txt @@ -10,8 +10,9 @@ FROM py ENV USING_DOCKER yes COPY --from=build /inst /usr/local - WORKDIR /logviewer CMD ["python", "app.py"] COPY . /logviewer - +RUN adduser --disabled-password --gecos '' app && \ + chown -R app /logviewer +USER app