Skip to content

Commit

Permalink
add mercure user during docker-type installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Jun 14, 2024
1 parent 3e6ec1c commit 1cf4cf3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ x-volumes-docker: &volumes-docker
- /var/run/docker.sock:/var/run/docker.sock

x-docker-user: &docker-user
user: "mercure:${GID}"

user: "${UID}:${DOCKER_GID}"
x-user: &user
user: "${UID}:${GID}"
services:
ui:
<<: *docker-user
Expand Down Expand Up @@ -46,6 +47,7 @@ services:
test: [ "CMD-SHELL", "pg_isready -U mercure" ]

receiver:
<<: *user
image: mercureimaging/mercure-receiver${IMAGE_TAG}
restart: always
depends_on:
Expand All @@ -57,6 +59,7 @@ services:
<<: *env

cleaner:
<<: *user
image: mercureimaging/mercure-cleaner${IMAGE_TAG}
restart: always
depends_on:
Expand All @@ -66,6 +69,7 @@ services:
<<: *env

dispatcher:
<<: *user
image: mercureimaging/mercure-dispatcher${IMAGE_TAG}
restart: always
depends_on:
Expand All @@ -85,6 +89,7 @@ services:
<<: *env

router:
<<: *user
image: mercureimaging/mercure-router${IMAGE_TAG}
restart: always
depends_on:
Expand All @@ -94,6 +99,7 @@ services:
<<: *env

bookkeeper:
<<: *user
image: mercureimaging/mercure-bookkeeper${IMAGE_TAG}
restart: always
depends_on:
Expand Down
8 changes: 6 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ setup_docker () {
if [ ! -f "$MERCURE_BASE"/docker-compose.yml ]; then
echo "## Copying docker-compose.yml..."
sudo cp $MERCURE_SRC/docker/docker-compose.yml $MERCURE_BASE
sudo sed -i -e "s/\\\${GID}/$(getent group docker | cut -d: -f3)/g" $MERCURE_BASE/docker-compose.yml
sudo sed -i -e "s/\\\${DOCKER_GID}/$(getent group docker | cut -d: -f3)/g" $MERCURE_BASE/docker-compose.yml
sudo sed -i -e "s/\\\${UID}/$(getent passwd mercure | cut -d: -f3)/g" $MERCURE_BASE/docker-compose.yml
sudo sed -i -e "s/\\\${GID}/$(getent passwd mercure | cut -d: -f4)/g" $MERCURE_BASE/docker-compose.yml

sudo sed -i "s/\\\${IMAGE_TAG}/$IMAGE_TAG/g" $MERCURE_BASE/docker-compose.yml
sudo chown $OWNER:$OWNER "$MERCURE_BASE"/docker-compose.yml
fi
Expand Down Expand Up @@ -396,6 +399,7 @@ systemd_install () {

docker_install () {
echo "## Performing docker-type mercure installation..."
create_user
create_folders
install_configuration
install_docker
Expand Down Expand Up @@ -501,4 +505,4 @@ case "$INSTALL_TYPE" in
;;
esac

echo "Installation complete"
echo "Installation complete"

0 comments on commit 1cf4cf3

Please sign in to comment.