akra35567 commited on
Commit
ed904da
·
1 Parent(s): dce76f4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +77 -5
Dockerfile CHANGED
@@ -1,6 +1,78 @@
1
- # Dockerfile para IA Akira
2
- FROM python:3.11-slim
3
- WORKDIR /app
4
- COPY . .
5
- RUN pip install --upgrade pip && pip install -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  CMD ["python", "main.py"]
 
1
+ # =====================================================
2
+ # Dockerfile - Akira IA (YAYA-23-8B + GPU + Cache)
3
+ # =====================================================
4
+ FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
5
+
6
+ # Evita interações
7
+ ENV DEBIAN_FRONTEND=noninteractive
8
+ ENV PYTHONUNBUFFERED=1
9
+ ENV PYTHONDONTWRITEBYTECODE=1
10
+
11
+ # =====================================================
12
+ # 1. SISTEMA + DEPENDÊNCIAS
13
+ # =====================================================
14
+ RUN apt-get update && apt-get install -y --no-install-recommends \
15
+ python3.11 \
16
+ python3.11-dev \
17
+ python3-pip \
18
+ python3-venv \
19
+ git \
20
+ git-lfs \
21
+ curl \
22
+ wget \
23
+ build-essential \
24
+ libglib2.0-0 \
25
+ libsm6 \
26
+ libxext6 \
27
+ libxrender-dev \
28
+ ffmpeg \
29
+ && rm -rf /var/lib/apt/lists/*
30
+
31
+ # Link python
32
+ RUN ln -sf /usr/bin/python3.11 /usr/bin/python
33
+
34
+ # =====================================================
35
+ # 2. DIRETÓRIO + CÓDIGO
36
+ # =====================================================
37
+ WORKDIR /app
38
+
39
+ # Copia apenas o necessário primeiro (cache)
40
+ COPY requirements.txt .
41
+ COPY modules/ modules/
42
+ COPY main.py .
43
+
44
+ # =====================================================
45
+ # 3. PYTHON + DEPENDÊNCIAS
46
+ # =====================================================
47
+ RUN pip install --upgrade pip && \
48
+ pip install --no-cache-dir -r requirements.txt && \
49
+ pip cache purge
50
+
51
+ # =====================================================
52
+ # 4. BAIXA YAYA-23-8B (OU FALLBACK)
53
+ # =====================================================
54
+ RUN mkdir -p models && \
55
+ cd models && \
56
+ git lfs install && \
57
+ echo "Baixando YAYA-23-8B..." && \
58
+ (git clone https://huggingface.co/angola-ai/yaya-23-8b || \
59
+ echo "YAYA não encontrado. Baixando Llama 3.1 8B como fallback..." && \
60
+ git clone https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct yaya-23-8b) && \
61
+ echo "Modelo pronto em ./models/yaya-23-8b"
62
+
63
+ # =====================================================
64
+ # 5. PERMISSÕES + LIMPEZA
65
+ # =====================================================
66
+ RUN chmod -R 755 /app
67
+
68
+ # =====================================================
69
+ # 6. PORTA + COMANDO
70
+ # =====================================================
71
+ EXPOSE 7860
72
+
73
+ # Variável de ambiente para GPU
74
+ ENV NVIDIA_VISIBLE_DEVICES=all
75
+ ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
76
+
77
+ # Inicia a API
78
  CMD ["python", "main.py"]