mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +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,11 +1,7 @@
|
||||||
FROM docker.io/cimg/node:current-browsers
|
FROM docker.io/cimg/node:current-browsers
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install gosu to run command as a specific user, circleci. Clean up lists.
|
|
||||||
USER root
|
USER root
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y gosu && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install app dependencies
|
# Install app dependencies
|
||||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "In node_entrypoint.sh"
|
|
||||||
whoami
|
|
||||||
|
|
||||||
# Get UID and GID of the /app directory owner
|
# Get UID and GID of the /app directory owner
|
||||||
HOST_UID=$(stat -c '%u' /app)
|
HOST_UID=$(stat -c '%u' /app)
|
||||||
HOST_GID=$(stat -c '%g' /app)
|
HOST_GID=$(stat -c '%g' /app)
|
||||||
|
|
||||||
# Update circleci user's UID and GID to match the host
|
# 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)"
|
echo "Updating circleci user and group to match host UID:GID ($HOST_UID:$HOST_GID)"
|
||||||
sudo groupmod -g "$HOST_GID" circleci
|
groupmod -g "$HOST_GID" circleci
|
||||||
sudo usermod -u "$HOST_UID" 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
|
# 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
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "In run_node_watch.sh"
|
|
||||||
whoami
|
|
||||||
npm install
|
npm install
|
||||||
npm rebuild
|
npm rebuild
|
||||||
dir=./registrar/assets
|
dir=./registrar/assets
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue