diff --git a/.changeset/violet-elephants-sit.md b/.changeset/violet-elephants-sit.md new file mode 100644 index 0000000000..ae72cc68c8 --- /dev/null +++ b/.changeset/violet-elephants-sit.md @@ -0,0 +1,5 @@ +--- +"create-t3-app": patch +--- + +Resolved issue where database startup script did not check for docker daemon being up and running diff --git a/cli/template/extras/start-database/mysql.sh b/cli/template/extras/start-database/mysql.sh index 268df5cc53..731725c31c 100755 --- a/cli/template/extras/start-database/mysql.sh +++ b/cli/template/extras/start-database/mysql.sh @@ -16,6 +16,11 @@ if ! [ -x "$(command -v docker)" ]; then exit 1 fi +if ! docker info > /dev/null 2>&1; then + echo "Docker daemon is not running. Please start Docker and try again." + exit 1 +fi + if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then echo "Database container '$DB_CONTAINER_NAME' already running" exit 0 diff --git a/cli/template/extras/start-database/postgres.sh b/cli/template/extras/start-database/postgres.sh index 11fb2042ad..378f19e23c 100755 --- a/cli/template/extras/start-database/postgres.sh +++ b/cli/template/extras/start-database/postgres.sh @@ -16,6 +16,11 @@ if ! [ -x "$(command -v docker)" ]; then exit 1 fi +if ! docker info > /dev/null 2>&1; then + echo "Docker daemon is not running. Please start Docker and try again." + exit 1 +fi + if [ "$(docker ps -q -f name=$DB_CONTAINER_NAME)" ]; then echo "Database container '$DB_CONTAINER_NAME' already running" exit 0