From aa1685209b6a81ef794cda482ae69bb4faa7f875 Mon Sep 17 00:00:00 2001 From: AI Studio Assistant Date: Sat, 9 May 2026 03:02:31 +0000 Subject: [PATCH] fix(deploy): altera a porta do Nginx e Dockerfile para 8080 para evitar erro de Bad Gateway no Coolify --- Dockerfile | 4 ++-- nginx.conf | 2 +- scripts/fix-gateway-push.ts | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 scripts/fix-gateway-push.ts diff --git a/Dockerfile b/Dockerfile index 6b9a5cf..f7e4625 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,8 @@ COPY --from=builder /app/dist /usr/share/nginx/html # Copy our custom nginx configuration COPY nginx.conf /etc/nginx/conf.d/default.conf -# Expose port 80 -EXPOSE 80 +# Expose port 8080 +EXPOSE 8080 # Start nginx CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf index 7e14fb5..69e5ffb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,5 +1,5 @@ server { - listen 80; + listen 8080; server_name _; root /usr/share/nginx/html; diff --git a/scripts/fix-gateway-push.ts b/scripts/fix-gateway-push.ts new file mode 100644 index 0000000..54f8f1d --- /dev/null +++ b/scripts/fix-gateway-push.ts @@ -0,0 +1,23 @@ +import { execSync } from 'child_process'; + +async function fixAndPush() { + try { + console.log('\nAdicionando arquivos corrigidos para o Coolify (porta 8080)...'); + execSync('git add Dockerfile nginx.conf scripts/fix-gateway-push.ts', { stdio: 'inherit' }); + + try { + execSync('git commit -m "fix(deploy): altera a porta do Nginx e Dockerfile para 8080 para evitar erro de Bad Gateway no Coolify"', { stdio: 'inherit' }); + } catch (e) { + console.log('Nada para commitar.'); + } + + console.log('\nFazendo push do código...'); + execSync('git push origin main', { stdio: 'inherit' }); + + console.log(`\n🎉 Resolvido e push concluído com sucesso!`); + } catch (error: any) { + console.error('\n❌ Ocorreu um erro:', error.message); + } +} + +fixAndPush();