Skip to content

Commit

Permalink
ows user is not 1000, it's 1001?
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed Aug 20, 2024
1 parent 23fc252 commit 4869657
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ services:
# Uncomment for use with non-dockerised postgres (for docker-compose 1.x)
# network_mode: host
environment:
LOCAL_UID: ${LOCAL_UID:-1000}
LOCAL_GID: ${LOCAL_GID:-1000}
LOCAL_UID: ${LOCAL_UID:-1001}
LOCAL_GID: ${LOCAL_GID:-1001}
# Defaults are defined in .env file
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
Expand Down
13 changes: 7 additions & 6 deletions docker/files/remap-user.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash -e

# Script that gives the container user uid $LOCAL_UID and gid $LOCAL_GID.
# If $LOCAL_UID or $LOCAL_GID are not set, they default to 1000 (default
# If $LOCAL_UID or $LOCAL_GID are not set, they default to 1001 (default
# for the first user created in Ubuntu).

USER_ID=${LOCAL_UID:-1000}
GROUP_ID=${LOCAL_GID:-1000}
USER_ID=${LOCAL_UID:-1001}
GROUP_ID=${LOCAL_GID:-1001}
OWS_ID=$(id -u ows)

[[ "$USER_ID" == "1000" ]] || usermod -u $USER_ID -o -m -d /home/ows ows
[[ "$GROUP_ID" == "1000" ]] || groupmod -g $GROUP_ID ows
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ubuntu"
[[ "$USER_ID" == "$OWS_ID" ]] || usermod -u $USER_ID -o -m -d /home/ows ows
[[ "$GROUP_ID" == "$OWS_ID" ]] || groupmod -g $GROUP_ID ows
[[ $(id -u) != "0" ]] || GOSU="/usr/sbin/gosu ows"
exec /usr/bin/tini -- $GOSU "$@"

0 comments on commit 4869657

Please # to comment.