Skip to content

Commit

Permalink
docker install: allow overriding dev image tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Dec 13, 2024
1 parent 0973904 commit 3a440da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 9 additions & 9 deletions docker/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,42 @@ x-volumes-docker: &volumes-docker

services:
receiver:
image: mercureimaging/mercure-receiver:latest
image: mercureimaging/mercure-receiver${IMAGE_TAG}
<<: *env
<<: *volumes

ui:
image: mercureimaging/mercure-ui:latest
image: mercureimaging/mercure-ui${IMAGE_TAG}
<<: *env
<<: *volumes-docker

cleaner:
image: mercureimaging/mercure-cleaner:latest
image: mercureimaging/mercure-cleaner${IMAGE_TAG}
<<: *env
<<: *volumes

dispatcher:
image: mercureimaging/mercure-dispatcher:latest
image: mercureimaging/mercure-dispatcher${IMAGE_TAG}
<<: *env
<<: *volumes

processor:
image: mercureimaging/mercure-processor:latest
image: mercureimaging/mercure-processor${IMAGE_TAG}
<<: *env
<<: *volumes-docker

router:
image: mercureimaging/mercure-router:latest
image: mercureimaging/mercure-router${IMAGE_TAG}
<<: *env
<<: *volumes

bookkeeper:
image: mercureimaging/mercure-bookkeeper:latest
image: mercureimaging/mercure-bookkeeper${IMAGE_TAG}
<<: *env
<<: *volumes

worker_fast:
image: mercureimaging/mercure-worker:latest
image: mercureimaging/mercure-worker${IMAGE_TAG}
restart: always
depends_on:
- redis
Expand All @@ -69,7 +69,7 @@ services:
<<: *volumes

worker_slow:
image: mercureimaging/mercure-worker:latest
image: mercureimaging/mercure-worker${IMAGE_TAG}
restart: always
depends_on:
- redis
Expand Down
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ ! -f "app/VERSION" ]; then
exit 1
fi
VERSION=`cat app/VERSION`
IMAGE_TAG=":$VERSION"
IMAGE_TAG=":${MERCURE_TAG:-$VERSION}"
VER_LENGTH=${#VERSION}+28
echo ""
echo "mercure Installer - Version $VERSION"
Expand Down Expand Up @@ -327,6 +327,11 @@ setup_docker_dev () {
echo "## Copying docker-compose.override.yml..."
sudo cp $MERCURE_SRC/docker/docker-compose.override.yml $MERCURE_BASE
sudo sed -i -e "s;MERCURE_SRC;$(readlink -f $MERCURE_SRC)/app;" "$MERCURE_BASE"/docker-compose.override.yml
if [[ -v MERCURE_TAG ]]; then # a custom tag was provided
sudo sed -i "s/\\\${IMAGE_TAG}/\:$MERCURE_TAG/g" $MERCURE_BASE/docker-compose.override.yml
else # no custom tag was provided, use latest
sudo sed -i "s/\\\${IMAGE_TAG}/\:latest/g" $MERCURE_BASE/docker-compose.override.yml
fi
sudo chown $OWNER:$OWNER "$MERCURE_BASE"/docker-compose.override.yml
fi
}
Expand Down Expand Up @@ -366,6 +371,7 @@ install_app_files() {
sudo chown -h $OWNER:$OWNER ./app
link_binaries
sudo chown -R $OWNER:$OWNER "$MERCURE_SRC/app"
sudo chmod g+w "$MERCURE_SRC/app"
# the mercure user and running user will be in each other's groups
sudo usermod -aG $OWNER $(logname)
sudo usermod -aG $(logname) $OWNER
Expand Down

0 comments on commit 3a440da

Please sign in to comment.