diff --git a/docker-compose/setup-script/noco.sh b/docker-compose/setup-script/noco.sh index 540881c4e1..e4112b2212 100755 --- a/docker-compose/setup-script/noco.sh +++ b/docker-compose/setup-script/noco.sh @@ -53,9 +53,9 @@ install_package() { fi } -# Function to check if sudo is required for Docker Compose command -check_for_docker_compose_sudo() { - if docker-compose ps >/dev/null 2>&1; then +# Function to check if sudo is required for Docker command +check_for_docker_sudo() { + if docker ps >/dev/null 2>&1; then echo "n" else echo "y" @@ -107,7 +107,7 @@ read_number_range() { # ******************** SYSTEM REQUIREMENTS CHECK START ************************* # Check if the following requirements are met: -# a. docker, docker-compose, jq installed +# a. docker, jq installed # b. port mapping check : 80,443 are free or being used by nginx container REQUIRED_PORTS=(80 443) @@ -121,14 +121,11 @@ if ! command_exists wget; then fi # d. Check if required tools are installed -echo " | Checking if required tools (docker, docker-compose, lsof) are installed..." -for tool in docker docker-compose lsof openssl; do +echo " | Checking if required tools (docker, lsof) are installed..." +for tool in docker lsof openssl; do if ! command_exists "$tool"; then echo "$tool is not installed. Setting up for installation..." - if [ "$tool" = "docker-compose" ]; then - sudo -E curl -L https://github.com/docker/compose/releases/download/1.29.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose - sudo chmod +x /usr/local/bin/docker-compose - elif [ "$tool" = "docker" ]; then + if [ "$tool" = "docker" ]; then wget -qO- https://get.docker.com/ | sh elif [ "$tool" = "lsof" ]; then install_package lsof @@ -306,6 +303,10 @@ services: nocodb: image: ${IMAGE} env_file: docker.env + deploy: + mode: replicated + replicas: ${NUM_INSTANCES} + endpoint_mode: dnsrr depends_on: - db ${DEPENDS_ON} @@ -524,20 +525,20 @@ server { EOF fi -IS_DOCKER_COMPOSE_REQUIRE_SUDO=$(check_for_docker_compose_sudo) +IS_DOCKER_REQUIRE_SUDO=$(check_for_docker_sudo) # Generate the update.sh file for upgrading images -if [ "$IS_DOCKER_COMPOSE_REQUIRE_SUDO" = "y" ]; then +if [ "$IS_DOCKER_REQUIRE_SUDO" = "y" ]; then cat > ./update.sh < ./update.sh <