fix: add host para acessar o opensearch
All checks were successful
Deploy ASP.NET MVC to OCI / build-and-deploy (push) Successful in 4m33s

This commit is contained in:
Ricardo Carneiro 2025-09-15 10:20:06 -03:00
parent 84b058904f
commit 205c6b027c

View File

@ -89,13 +89,11 @@ jobs:
# Puxa nova imagem ARM64 # Puxa nova imagem ARM64
docker pull registry.redecarneir.us/convertit:latest docker pull registry.redecarneir.us/convertit:latest
# Executa o novo container na porta 80 # Executa o novo container na porta 80 com network host para acessar OpenSearch
docker run -d \ docker run -d \
--name convertit \ --name convertit \
--restart unless-stopped \ --restart unless-stopped \
--add-host="k3ss1:172.17.0.1" \ --network host \
--add-host="k3sw2:172.17.0.1" \
-p 80:8080 \
--memory=2g \ --memory=2g \
--cpus=1.5 \ --cpus=1.5 \
--health-cmd="curl -f http://localhost:8080/health || exit 1" \ --health-cmd="curl -f http://localhost:8080/health || exit 1" \
@ -118,9 +116,9 @@ jobs:
# Verifica se o container está rodando # Verifica se o container está rodando
docker ps | grep convertit docker ps | grep convertit
# Testa se a aplicação está respondendo na porta 80 # Testa se a aplicação está respondendo na porta 8080 (com network host)
sleep 10 sleep 10
curl -f http://localhost:80 || echo "Aplicação pode estar inicializando..." curl -f http://localhost:8080 || echo "Aplicação pode estar inicializando..."
- name: Deploy to Staging (x86_64) - name: Deploy to Staging (x86_64)
if: startsWith(github.ref, 'refs/heads/release/') if: startsWith(github.ref, 'refs/heads/release/')
@ -189,7 +187,10 @@ jobs:
docker logs convertit --tail 20 docker logs convertit --tail 20
echo "=== Teste de conectividade ===" echo "=== Teste de conectividade ==="
curl -I http://localhost:80 || echo "Aplicação ainda não está acessível" curl -I http://localhost:8080 || echo "Aplicação ainda não está acessível"
echo "=== Teste de conectividade OpenSearch ==="
curl -I http://localhost:9202 || echo "OpenSearch não está acessível"
- name: Verify staging deployment - name: Verify staging deployment
if: startsWith(github.ref, 'refs/heads/release/') if: startsWith(github.ref, 'refs/heads/release/')