Skip to content

Commit

Permalink
be compatible with podman-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Dec 23, 2023
1 parent e20a2e5 commit 4f78210
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
29 changes: 22 additions & 7 deletions dev-peerdb.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
#!/bin/bash
set -Eeuo pipefail
#!/bin/sh
if test -z "$USE_PODMAN"
then
if ! command -v docker &> /dev/null
then
if command -v podman-compose
then
echo "docker could not be found on PATH, using podman-compose"
USE_PODMAN=1
else
echo "docker could not be found on PATH"
exit 1
fi
fi
fi

if ! command -v docker &> /dev/null
if test -z "$USE_PODMAN"
then
echo "docker could not be found on PATH"
exit 1
DOCKER="docker compose"
EXTRA_ARGS="--no-attach temporal --no-attach pyroscope --no-attach temporal-ui"
else
DOCKER="podman-compose --podman-run-args=--replace"
EXTRA_ARGS=""
fi

export PEERDB_VERSION_SHA_SHORT=local-$(git rev-parse --short HEAD)
docker compose -f docker-compose-dev.yml up --build \
--no-attach temporal --no-attach pyroscope --no-attach temporal-ui
exec $DOCKER -f docker-compose-dev.yml up --build $EXTRA_ARGS
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres", "-U", "postgres"]
test: ["CMD", "pg_isready", "-d", "postgres", "-U", "postgres"]
interval: 10s
timeout: 30s
retries: 5
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "postgres", "-U", "postgres"]
test: ["CMD", "pg_isready", "-d", "postgres", "-U", "postgres"]
interval: 10s
timeout: 30s
retries: 5
Expand Down

0 comments on commit 4f78210

Please sign in to comment.