File size: 1,708 Bytes
c2c4c6f
 
 
0211e6e
feec22e
 
9374a4b
 
c2c4c6f
0211e6e
feec22e
c2c4c6f
9374a4b
b3b94f2
0211e6e
 
 
c2c4c6f
 
 
 
 
0211e6e
c2c4c6f
b3b94f2
 
c2c4c6f
 
 
 
0c148f6
0211e6e
0c148f6
 
b3b94f2
c2c4c6f
b3b94f2
9374a4b
c2c4c6f
 
 
 
f0322a6
 
c2c4c6f
 
0211e6e
c2c4c6f
1878ef1
0211e6e
c2c4c6f
 
 
9374a4b
c2c4c6f
 
 
9374a4b
c2c4c6f
 
1878ef1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Dockerfile.lite - para.AI v3.0 com SQLite
# Build ~2min (vs ~8min com PostgreSQL)
# Imagem ~300MB (vs ~800MB com PostgreSQL)

## OBJETIVO SIMPLIFICAR SQUEMAS E ESPECIALISTAS ## 

FROM python:3.11-slim

# Metadata
LABEL maintainer="para.AI Team"
LABEL version="3.1.0-sqlite"
LABEL description="para.AI API - SQLite Test Version"

# Variáveis de ambiente
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    DEBIAN_FRONTEND=noninteractive \
    APP_ENV=development \
    DATABASE_TYPE=sqlite \
    DATABASE_URL=sqlite:///./data/para_ai.db

# Criar diretórios
WORKDIR /app

RUN mkdir -p /app/data /app/logs /app/data/files /app/data/uploads \
             /app/data/outputs /app/data/temp /app/data/backups

# Instalar dependências mínimas do sistema
RUN apt-get update && apt-get install -y --no-install-recommends \
    gcc \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copiar requirements
COPY requirements.txt .

# Instalar dependências Python
RUN pip install --no-cache-dir -r requirements.txt

# Copiar código da aplicação
COPY . .

# Criar arquivo SQLite vazio (será populado na primeira execução)
RUN touch /app/data/para_ai.db && chmod 666 /app/data/para_ai.db

# Expor porta
EXPOSE 7860

# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
    CMD curl -f http://localhost:8000/health || exit 1

# Script de inicialização
COPY scripts/docker-entrypoint-lite.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh

# Comando de inicialização
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]