From 5679ab435f58483af8d0a43c6baa0c3ae01dd69c Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Fri, 24 Sep 2021 08:16:07 +0200 Subject: [PATCH] Use user name instead of userid Nginx unit needs the user and group parameter as names. --- Dockerfile | 1 + docker-compose.test.yml | 2 +- docker-compose.yml | 2 +- docker/launch-netbox.sh | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27597e5..cf6b883 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,7 @@ WORKDIR /opt/netbox/netbox # Must set permissions for '/opt/netbox/netbox/media' directory # to g+w so that pictures can be uploaded to netbox. RUN mkdir -p static /opt/unit/state/ /opt/unit/tmp/ \ + && chown -R unit:root media /opt/unit/ \ && chmod -R g+w media /opt/unit/ \ && cd /opt/netbox/ && /opt/netbox/venv/bin/python -m mkdocs build \ --config-file /opt/netbox/mkdocs.yml --site-dir /opt/netbox/netbox/project-static/docs/ \ diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 1ca0903..c6c014c 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -9,7 +9,7 @@ services: env_file: env/netbox.env environment: SKIP_STARTUP_SCRIPTS: ${SKIP_STARTUP_SCRIPTS-false} - user: '101' + user: 'unit:root' volumes: - ./startup_scripts:/opt/netbox/startup_scripts:z,ro - ./${INITIALIZERS_DIR-initializers}:/opt/netbox/initializers:z,ro diff --git a/docker-compose.yml b/docker-compose.yml index 2dbd7df..ef15590 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - redis-cache - netbox-worker env_file: env/netbox.env - user: '101' + user: 'unit:root' volumes: - ./startup_scripts:/opt/netbox/startup_scripts:z,ro - ./initializers:/opt/netbox/initializers:z,ro diff --git a/docker/launch-netbox.sh b/docker/launch-netbox.sh index 117772f..09efdb5 100755 --- a/docker/launch-netbox.sh +++ b/docker/launch-netbox.sh @@ -52,5 +52,5 @@ exec unitd \ --log /dev/stdout \ --state /opt/unit/state/ \ --tmp /opt/unit/tmp/ \ - --user 101 \ - --group 0 + --user unit \ + --group root