fix(deploy): change to sequential builds to reduce QNAP resource contention
CI / CD Pipeline / build (push) Successful in 7m18s
CI / CD Pipeline / deploy (push) Successful in 3m49s

This commit is contained in:
2026-06-18 15:35:00 +07:00
parent 09e304de84
commit e8e10e8c04
+7 -9
View File
@@ -32,23 +32,21 @@ fi
cd "$SOURCE_DIR" cd "$SOURCE_DIR"
# เปิด BuildKit เพื่อ layer cache และ parallel build # เปิด BuildKit เพื่อ layer cache
export DOCKER_BUILDKIT=1 export DOCKER_BUILDKIT=1
# [1/3] Build images (parallel) # [1/3] Build images (sequential to reduce resource contention)
echo "[1/3] Building Docker images (parallel)..." echo "[1/3] Building Docker images (sequential)..."
docker build -f backend/Dockerfile -t lcbp3-backend:latest . & echo " Building backend..."
BACKEND_PID=$! docker build -f backend/Dockerfile -t lcbp3-backend:latest . || { echo "✗ Backend build failed!"; exit 1; }
echo " Building frontend..."
docker build -f frontend/Dockerfile \ docker build -f frontend/Dockerfile \
--build-arg NEXT_PUBLIC_API_URL="$API_URL" \ --build-arg NEXT_PUBLIC_API_URL="$API_URL" \
--build-arg AUTH_URL="$AUTH_URL" \ --build-arg AUTH_URL="$AUTH_URL" \
-t lcbp3-frontend:latest . & -t lcbp3-frontend:latest . || { echo "✗ Frontend build failed!"; exit 1; }
FRONTEND_PID=$!
wait $BACKEND_PID || { echo "✗ Backend build failed!"; exit 1; }
wait $FRONTEND_PID || { echo "✗ Frontend build failed!"; exit 1; }
echo "✓ Images built" echo "✓ Images built"
# [2/3] Start / restart stack with new images # [2/3] Start / restart stack with new images