akra35567 commited on
Commit
4ebde2b
Β·
verified Β·
1 Parent(s): 9bef4e2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -3
Dockerfile CHANGED
@@ -1,21 +1,37 @@
1
  # Dockerfile β€” AKIRA BOT HUGGING FACE SPACES (Atualizado Janeiro 2026)
2
  # βœ… Otimizado para ambiente de containers restritos (sistema de arquivos somente leitura)
3
  # βœ… CorreΓ§Γ£o de DNS/IPv4 para erro web.whatsapp.com no Hugging Face
 
4
 
5
  FROM node:20-alpine
6
 
7
  # ═══════════════════════════════════════════════════════════════════
8
- # VARIÁVEIS DE AMBIENTE (CORREÇÃO DE CONEXΓƒO)
9
  # ═══════════════════════════════════════════════════════════════════
10
  ENV NODE_ENV=production \
11
  PORT=7860 \
12
  TOOLS_INSTALLED=true \
13
- # SOLUÇÃO PARA ERRO DNS NO HUGGING FACE:
14
  NODE_OPTIONS="--dns-result-order=ipv4first --no-warnings" \
 
 
 
 
15
  LANG=C.UTF-8 \
16
  # ConfiguraΓ§Γ΅es especΓ­ficas para Hugging Face:
17
  DATA_DIR=/tmp/akira_data
18
 
 
 
 
 
 
 
 
 
 
 
 
19
  # ═══════════════════════════════════════════════════════════════════
20
  # INSTALAR DEPENDÊNCIAS DO SISTEMA ESSENCIAIS
21
  # ═══════════════════════════════════════════════════════════════════
@@ -139,4 +155,5 @@ HEALTHCHECK --interval=60s --timeout=20s --start-period=120s --retries=3 \
139
  CMD curl -f http://localhost:7860/health 2>/dev/null || wget -q --spider http://localhost:7860/health 2>/dev/null || exit 1
140
 
141
  # Comando de inicializaΓ§Γ£o com variΓ‘veis de ambiente para DNS
142
- CMD ["sh", "-c", "node --dns-result-order=ipv4first index.js"]
 
 
1
  # Dockerfile β€” AKIRA BOT HUGGING FACE SPACES (Atualizado Janeiro 2026)
2
  # βœ… Otimizado para ambiente de containers restritos (sistema de arquivos somente leitura)
3
  # βœ… CorreΓ§Γ£o de DNS/IPv4 para erro web.whatsapp.com no Hugging Face
4
+ # βœ… ConfiguraΓ§Γ£o de DNS do Google (8.8.8.8) para resolver QR code
5
 
6
  FROM node:20-alpine
7
 
8
  # ═══════════════════════════════════════════════════════════════════
9
+ # VARIÁVEIS DE AMBIENTE (CORREÇÃO DE CONEXΓƒO DNS - CRÍTICO)
10
  # ═══════════════════════════════════════════════════════════════════
11
  ENV NODE_ENV=production \
12
  PORT=7860 \
13
  TOOLS_INSTALLED=true \
14
+ # SOLUÇÃO PARA ERRO DNS NO HUGGING FACE (CRÍTICO PARA QR CODE):
15
  NODE_OPTIONS="--dns-result-order=ipv4first --no-warnings" \
16
+ # ForΓ§ar DNS do Google como fallback
17
+ RES_OPTIONS="timeout:10 attempts:3" \
18
+ # ConfiguraΓ§Γ΅es de rede otimizadas para containers
19
+ UV_THREADPOOL_SIZE=128 \
20
  LANG=C.UTF-8 \
21
  # ConfiguraΓ§Γ΅es especΓ­ficas para Hugging Face:
22
  DATA_DIR=/tmp/akira_data
23
 
24
+ # ═══════════════════════════════════════════════════════════════════
25
+ # CONFIGURAÇÃO DE DNS NO CONTAINER (CRÍTICO PARA HF SPACES)
26
+ # ═══════════════════════════════════════════════════════════════════
27
+ # Adiciona DNS do Google como fallback para resolver web.whatsapp.com
28
+ RUN echo "# ConfiguraΓ§Γ£o DNS para HF Spaces - Corrige QR Code\n\
29
+ nameserver 8.8.8.8\n\
30
+ nameserver 8.8.4.4\n\
31
+ nameserver 1.1.1.1\n\
32
+ options timeout:10 attempts:3" > /etc/resolv.conf && \
33
+ chmod 644 /etc/resolv.conf
34
+
35
  # ═══════════════════════════════════════════════════════════════════
36
  # INSTALAR DEPENDÊNCIAS DO SISTEMA ESSENCIAIS
37
  # ═══════════════════════════════════════════════════════════════════
 
155
  CMD curl -f http://localhost:7860/health 2>/dev/null || wget -q --spider http://localhost:7860/health 2>/dev/null || exit 1
156
 
157
  # Comando de inicializaΓ§Γ£o com variΓ‘veis de ambiente para DNS
158
+ CMD ["sh", "-c", "node --dns-result-order=ipv4first index.js"]
159
+