Optimize deployment for low-memory servers

- Skip activepieces rebuild when using --deploy-ap (already pre-built)
- Use --parallel 1 for builds to reduce memory usage
- Pass SKIP_AP_BUILD flag to remote deployment script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
poduck
2025-12-21 15:45:29 -05:00
parent c88b77a804
commit 7baf110235

View File

@@ -158,7 +158,14 @@ fi
# Step 3: Deploy on server # Step 3: Deploy on server
print_status "Step 3: Deploying on server..." print_status "Step 3: Deploying on server..."
# Set SKIP_AP_BUILD if we already deployed activepieces image
SKIP_AP_BUILD_FLAG=""
if $DEPLOY_AP; then
SKIP_AP_BUILD_FLAG="SKIP_AP_BUILD=true"
fi
ssh "$SERVER" "bash -s" << ENDSSH ssh "$SERVER" "bash -s" << ENDSSH
$SKIP_AP_BUILD_FLAG
set -e set -e
echo ">>> Setting up project directory..." echo ">>> Setting up project directory..."
@@ -221,12 +228,17 @@ git log -1 --oneline
cd smoothschedule cd smoothschedule
# Build images (all or specific services) # Build images (all or specific services)
# Note: If activepieces was pre-deployed via --deploy-ap, skip rebuilding it
if [[ -n "$SERVICES" ]]; then if [[ -n "$SERVICES" ]]; then
echo ">>> Building Docker images: $SERVICES..." echo ">>> Building Docker images: $SERVICES..."
docker compose -f docker-compose.production.yml build $SERVICES docker compose -f docker-compose.production.yml build --parallel 1 $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
else else
echo ">>> Building all Docker images..." echo ">>> Building all Docker images (with low parallelism for memory)..."
docker compose -f docker-compose.production.yml build docker compose -f docker-compose.production.yml build --parallel 1
fi fi
echo ">>> Starting containers..." echo ">>> Starting containers..."