fix: force container recreate with down+up, use wget for health check
Some checks failed
Deploy / deploy (push) Failing after 3m52s
Some checks failed
Deploy / deploy (push) Failing after 3m52s
- docker compose down + up forces container recreation with new labels - Replace curl (not in runner) with wget for internal health check - Health check against 127.0.0.1:3200 (internal, no domain needed)
This commit is contained in:
13
.github/workflows/deploy.yml
vendored
13
.github/workflows/deploy.yml
vendored
@@ -35,9 +35,16 @@ jobs:
|
|||||||
- name: Deploy containers
|
- name: Deploy containers
|
||||||
run: |
|
run: |
|
||||||
cd /home/deployer/api-ubigeo
|
cd /home/deployer/api-ubigeo
|
||||||
docker compose -f docker-compose.production.yml up -d --remove-orphans
|
docker compose -f docker-compose.production.yml down --remove-orphans
|
||||||
|
docker compose -f docker-compose.production.yml up -d
|
||||||
|
|
||||||
- name: Health check
|
- name: Health check
|
||||||
run: |
|
run: |
|
||||||
sleep 10
|
sleep 15
|
||||||
curl -f https://api-ubigeo.darkcodex.dev/api/v1/health
|
STATUS=$(wget -qO- http://127.0.0.1:3200/api/v1/health || echo "fail")
|
||||||
|
echo "Internal health: $STATUS"
|
||||||
|
if echo "$STATUS" | grep -q "ok"; then
|
||||||
|
echo "API is up"
|
||||||
|
else
|
||||||
|
echo "API health check failed" && exit 1
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user