diff --git a/deploy.sh b/deploy.sh index 94d88179..305fcda5 100755 --- a/deploy.sh +++ b/deploy.sh @@ -159,13 +159,13 @@ fi print_status "Step 3: Deploying on server..." # Set SKIP_AP_BUILD if we already deployed activepieces image -SKIP_AP_BUILD_FLAG="" +SKIP_AP_BUILD_VAL="false" if $DEPLOY_AP; then - SKIP_AP_BUILD_FLAG="SKIP_AP_BUILD=true" + SKIP_AP_BUILD_VAL="true" fi ssh "$SERVER" "bash -s" << ENDSSH -$SKIP_AP_BUILD_FLAG +SKIP_AP_BUILD="$SKIP_AP_BUILD_VAL" set -e echo ">>> Setting up project directory..." @@ -229,16 +229,18 @@ cd smoothschedule # Build images (all or specific services) # Note: If activepieces was pre-deployed via --deploy-ap, skip rebuilding it +# Use COMPOSE_PARALLEL_LIMIT to reduce memory usage on low-memory servers +export COMPOSE_PARALLEL_LIMIT=1 if [[ -n "$SERVICES" ]]; then echo ">>> Building Docker images: $SERVICES..." - docker compose -f docker-compose.production.yml build --parallel 1 $SERVICES + docker compose -f docker-compose.production.yml build $SERVICES elif [[ "$SKIP_AP_BUILD" == "true" ]]; then # Skip activepieces build since we pre-built and transferred it echo ">>> Building Docker images (excluding activepieces - pre-built)..." - docker compose -f docker-compose.production.yml build --parallel 1 django nginx traefik postgres celeryworker celerybeat flower awscli verdaccio + docker compose -f docker-compose.production.yml build django nginx traefik postgres celeryworker celerybeat flower awscli verdaccio else - echo ">>> Building all Docker images (with low parallelism for memory)..." - docker compose -f docker-compose.production.yml build --parallel 1 + echo ">>> Building all Docker images..." + docker compose -f docker-compose.production.yml build fi echo ">>> Starting containers..."