diff --git a/bin/make_env.sh b/bin/make_env.sh index 32dcd5f3..11fc614c 100755 --- a/bin/make_env.sh +++ b/bin/make_env.sh @@ -22,4 +22,6 @@ WIKIMEDIA_OAUTH2_SECRET=d6fa3dc12e064166a9b36ddf8ae37ceb61161e69 ES_HOSTS=search:9200 DJANGO_SUPERUSER_PASSWORD=$(mkpass) FIREFOX_DEVTOOL_HACK=false +LOCAL_UID=$(id -u) +LOCAL_GID=$(id -g) _EOF diff --git a/docker-compose.yaml b/docker-compose.yaml index 20440311..b487a1c3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,7 +6,8 @@ services: context: . dockerfile: .pipeline/local-python.Dockerfile image: "toolhub:dev-python" - user: somebody + # T295318: run container as local user to allow Linux mount writes + user: "${LOCAL_UID}:${LOCAL_GID}" working_dir: /srv/app command: > /srv/dockerize/bin/dockerize -wait tcp://db:3306 @@ -69,12 +70,17 @@ services: context: . dockerfile: .pipeline/dev-nodejs.Dockerfile image: "toolhub:dev-nodejs" - user: somebody + # T295318: run container as local user to allow Linux mount writes + user: "${LOCAL_UID}:${LOCAL_GID}" working_dir: /srv/app command: + # T295318: make a $HOME as $LOCAL_UID user so that npm has a place + # to cache files with the ownership it expects. - bash - -c - >- + mkdir -p /tmp/runtime-home && + export HOME=/tmp/runtime-home && npm install && npm run serve:vue volumes: