mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-31 06:56:33 +02:00
removed gosu and sudo dependencies
This commit is contained in:
parent
07b76fe002
commit
c3a3fd282a
3 changed files with 8 additions and 12 deletions
|
@ -1,16 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "In node_entrypoint.sh"
|
||||
whoami
|
||||
|
||||
# Get UID and GID of the /app directory owner
|
||||
HOST_UID=$(stat -c '%u' /app)
|
||||
HOST_GID=$(stat -c '%g' /app)
|
||||
|
||||
# Update circleci user's UID and GID to match the host
|
||||
echo "Updating circleci user and group to match host UID:GID ($HOST_UID:$HOST_GID)"
|
||||
sudo groupmod -g "$HOST_GID" circleci
|
||||
sudo usermod -u "$HOST_UID" circleci
|
||||
groupmod -g "$HOST_GID" circleci
|
||||
usermod -u "$HOST_UID" circleci
|
||||
|
||||
echo "Updating ownership of /app recursively to circleci:circleci"
|
||||
chown -R circleci:circleci /app
|
||||
|
||||
# Run command as circleci user. Note that command, run_node_watch.sh, is passed as arg to entrypoint
|
||||
exec gosu circleci "$@"
|
||||
echo "Switching to circleci user and running command: $@"
|
||||
su -s /bin/bash -c "$*" circleci
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue