From d0cef4ed71faa3aba3002bf78d3647b4cb0c32eb Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Fri, 24 Nov 2023 07:10:10 +0200 Subject: [PATCH] Dockerization: Add platform and change user uid Specify platform as "linux/amd64" for the app container in the docker-compose.yml, because that's what it's supposed to be and it won't even work on e.g. ARM based archs. (Some deps won't compile.) Change the appuser uid to 1000, since that is very often the same uid as the developer's uid on a Linux host, which could avoid some problems when the source tree is mounted as a volume to the container and still being modified from the host. --- Dockerfile | 2 +- docker-compose.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 164c09a3..43264844 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN pip install -r requirements.txt WORKDIR /app -RUN adduser -u 5678 --disabled-password --gecos "" appuser +RUN adduser -u 1000 --disabled-password --gecos "" appuser ENTRYPOINT ["./docker-entrypoint"] diff --git a/docker-compose.yml b/docker-compose.yml index 10ef2af9..cc2a95ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ services: volumes: - db_data:/var/lib/postgresql/data app: + platform: "linux/amd64" image: parkkihubi build: context: "."