Skip to content

Commit

Permalink
fix: migrate to docker compose (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnahkies authored Sep 22, 2024
1 parent 1c36e6a commit 0442424
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions applications/watchdog-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ INTERNAL_APPLICATIONS="${DATA_BASE_PATH}/applications-internal/*.yaml"
for APP in $INTERNAL_APPLICATIONS; do
echo $APP
APP_NAME=$(basename $APP ".yaml")
docker-compose --file "$APP" -p "$APP_NAME" down --remove-orphans
docker compose --file "$APP" -p "$APP_NAME" down --remove-orphans
done

PUBLIC_APPLICATIONS="${DATA_BASE_PATH}/applications-public/*.yaml"

for APP in $PUBLIC_APPLICATIONS; do
echo $APP
APP_NAME=$(basename $APP ".yaml")
docker-compose --file "$APP" -p "$APP_NAME" down --remove-orphans
docker compose --file "$APP" -p "$APP_NAME" down --remove-orphans
done
4 changes: 2 additions & 2 deletions applications/watchdog-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ INTERNAL_APPLICATIONS="${DATA_BASE_PATH}/applications-internal/*.yaml"
for APP in $INTERNAL_APPLICATIONS; do
echo $APP
APP_NAME=$(basename $APP ".yaml")
docker-compose --file "$APP" -p $APP_NAME up -d --force-recreate --remove-orphans
docker compose --file "$APP" -p $APP_NAME up -d --force-recreate --remove-orphans
done

PUBLIC_APPLICATIONS="${DATA_BASE_PATH}/applications-public/*.yaml"

for APP in $PUBLIC_APPLICATIONS; do
echo $APP
APP_NAME=$(basename $APP ".yaml")
docker-compose --file "$APP" -p $APP_NAME up -d --force-recreate --remove-orphans
docker compose --file "$APP" -p $APP_NAME up -d --force-recreate --remove-orphans
done

"$__dir"/../proxy/reload-haproxy-config.sh
2 changes: 1 addition & 1 deletion docs/postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ chown -R 999 ~/data/postgres/$NEW_VERSION
chmod -R 700 ~/data/postgres/$NEW_VERSION
# Stop the database
docker-compose -f ~/data/applications-internal/postgres.yaml -p ~/data/applications-internal/postgres.yaml down --remove-orphans
docker compose -f ~/data/applications-internal/postgres.yaml -p ~/data/applications-internal/postgres.yaml down --remove-orphans
# Run the upgrade
docker run -it --name=postgres-upgrade -v $HOME/data/postgres:/var/lib/postgresql tianon/postgres-upgrade:$OLD_VERSION-to-$NEW_VERSION --link
Expand Down
8 changes: 5 additions & 3 deletions init/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ sudo systemctl enable containerd.service
sudo systemctl start docker.service
sudo systemctl start containerd.service

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
OCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.29.6/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

docker version
docker-compose --version
docker compose --version

sudo docker run --rm hello-world

Expand Down
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ done

sleep 2

docker-compose --file "${__dir}"/docker-compose.yaml -p cluster-core up -d --force-recreate --remove-orphans
docker compose --file "${__dir}"/docker-compose.yaml -p cluster-core up -d --force-recreate --remove-orphans

"${__dir}"/applications/watchdog-up.sh
2 changes: 1 addition & 1 deletion stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source "${__dir}"/config.sh

set -x

docker-compose -f "${__dir}"/docker-compose.yaml -p cluster-core down --remove-orphans
docker compose -f "${__dir}"/docker-compose.yaml -p cluster-core down --remove-orphans

"${__dir}"/applications/watchdog-down.sh

Expand Down

0 comments on commit 0442424

Please sign in to comment.