Nielo47 commited on
Commit
e9498bb
·
unverified ·
1 Parent(s): 0be1024

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1) Base Python leve
2
+ FROM python:3.10-slim
3
+
4
+ # 2) Instala curl (para baixar Ollama) e dependências básicas
5
+ RUN apt-get update && apt-get install -y curl && \
6
+ # 3) Instala Ollama via script oficial
7
+ curl -fsSL https://ollama.com/install.sh | sh && \
8
+ apt-get clean && rm -rf /var/lib/apt/lists/*
9
+
10
+ # 4) Cria usuário não-root recomendado
11
+ RUN useradd -m -u 1000 user
12
+ USER user
13
+ ENV HOME=/home/user \
14
+ PATH="/home/user/.local/bin:$PATH"
15
+
16
+ WORKDIR $HOME/app
17
+
18
+ # 5) Copia app e requisitos
19
+ COPY --chown=user:user app.py requirements.txt ./
20
+
21
+ # 6) Instala libs Python
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # 7) Torna start.sh executável
25
+ COPY --chown=user:user start.sh ./
26
+ RUN chmod +x start.sh
27
+
28
+ # 8) Comando padrão: inicia Ollama e depois app
29
+ CMD ["./start.sh"]