From fe56029f6187e9ebe41028e8db4e5501de49147c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Fl=C3=BChmann?= Date: Thu, 4 Apr 2019 17:38:11 +0200 Subject: [PATCH] The process should not run as root in docker(#1267) --- docker/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 629ad304a..7162c6bb0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -39,6 +39,12 @@ ENV PGRST_DB_URI= \ PGRST_PRE_REQUEST= \ PGRST_ROLE_CLAIM_KEY=".role" +RUN groupadd -g 1000 postgrest && \ + useradd -r -u 1000 -g postgrest postgrest && \ + chown postgrest:postgrest /etc/postgrest.conf + +USER 1000 + # PostgREST reads /etc/postgrest.conf so map the configuration # file in when you run this container CMD exec postgrest /etc/postgrest.conf