Skip to content

Commit

Permalink
Delete the ubuntu user so ows gets 1000.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpacemanPaul committed Aug 20, 2024
1 parent 4869657 commit 6e551b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ RUN EXTRAS=$([ "$ENVIRONMENT" = "deployment" ] || echo ",test") && \
python3-pip))

# Configure user
RUN userdel -r ubuntu
RUN useradd -m -s /bin/bash ows
WORKDIR "/home/ubuntu"

Expand Down
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:-1001}
LOCAL_GID: ${LOCAL_GID:-1001}
LOCAL_UID: ${LOCAL_UID:-1000}
LOCAL_GID: ${LOCAL_GID:-1000}
# Defaults are defined in .env file
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
Expand Down
4 changes: 2 additions & 2 deletions docker/files/remap-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# 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:-1001}
GROUP_ID=${LOCAL_GID:-1001}
USER_ID=${LOCAL_UID:-1000}
GROUP_ID=${LOCAL_GID:-1000}
OWS_ID=$(id -u ows)

[[ "$USER_ID" == "$OWS_ID" ]] || usermod -u $USER_ID -o -m -d /home/ows ows
Expand Down

0 comments on commit 6e551b5

Please sign in to comment.