ASTAROTH0405 commited on
Commit
6cb66c7
·
verified ·
1 Parent(s): 0359134

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -35
Dockerfile CHANGED
@@ -1,44 +1,34 @@
1
- FROM python:3.11-slim-bullseye
2
 
3
  USER root
4
 
5
- # Dependencias del sistema (necesarias para algunos paquetes como faiss, spacy)
6
- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
7
- git libatlas-base-dev gfortran locales tzdata \
8
- && apt-get clean && rm -rf /var/lib/apt/lists/*
9
-
10
- # Configurar locale
11
- RUN sed -i -e 's/# \(en_US\.UTF-8 .*\)/\1/' /etc/locale.gen && \
12
- dpkg-reconfigure --frontend=noninteractive locales && \
13
- update-locale LANG=en_US.UTF-8 && \
14
- ln -sf /usr/share/zoneinfo/UTC /etc/localtime && \
15
- echo "UTC" > /etc/timezone
16
- ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 TZ=UTC
17
-
18
- WORKDIR /app
19
-
20
- # Clonar el repositorio
21
- RUN git clone --depth 1 https://github.com/agent0ai/agent-zero.git /app/agent-zero
22
-
23
- # Crear usuario no root
24
  RUN groupadd -g 1000 agent && \
25
- useradd -u 1000 -g 1000 -m -s /bin/bash agent
26
-
27
- # Instalar dependencias del requirements.txt (incluye kokoro) Y LUEGO litellm explícitamente
28
- RUN pip install --no-cache-dir --upgrade pip setuptools wheel --root-user-action=ignore && \
29
- pip install --no-cache-dir -r /app/agent-zero/requirements.txt --root-user-action=ignore && \
30
- pip install --no-cache-dir litellm --root-user-action=ignore && \
31
- pip show litellm # Verificar instalación
32
-
33
- # Crear directorios de persistencia
34
- RUN mkdir -p /a0/usr /data /home/agent/.local && \
35
- chown -R agent:agent /a0/usr /data /home/agent /app/agent-zero
36
-
37
- USER 1000
38
- EXPOSE 7860
39
 
 
40
  ENV RFC_PASSWORD="default_password_change_me" \
41
  A0_SET_RFC_URL="localhost" \
42
  A0_SET_RFC_PORT_HTTP=55080
43
 
44
- CMD ["python3", "/app/agent-zero/run_ui.py", "--host", "0.0.0.0", "--port", "7860", "--dockerized=True"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM agent0ai/agent-zero:latest
2
 
3
  USER root
4
 
5
+ # Crear usuario no root y directorios persistentes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  RUN groupadd -g 1000 agent && \
7
+ useradd -u 1000 -g 1000 -m -s /bin/bash agent && \
8
+ mkdir -p /a0/usr /data /home/agent/.local && \
9
+ chown -R agent:agent /a0/usr /data /home/agent
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ # Variables de entorno para RFC
12
  ENV RFC_PASSWORD="default_password_change_me" \
13
  A0_SET_RFC_URL="localhost" \
14
  A0_SET_RFC_PORT_HTTP=55080
15
 
16
+ # Copiar un script de inicio personalizado que lance la UI en el puerto 7860
17
+ RUN echo '#!/bin/bash
18
+ set -e
19
+ # Buscar el entorno virtual (puede estar en /a0/venv o /git/agent-zero/venv)
20
+ if [ -f /a0/venv/bin/activate ]; then
21
+ source /a0/venv/bin/activate
22
+ elif [ -f /git/agent-zero/venv/bin/activate ]; then
23
+ source /git/agent-zero/venv/bin/activate
24
+ else
25
+ echo "No se encontró el entorno virtual. Usando python del sistema."
26
+ fi
27
+ # Ejecutar la UI en el puerto 7860
28
+ cd /git/agent-zero
29
+ exec python run_ui.py --host 0.0.0.0 --port 7860 --dockerized=True
30
+ ' > /start.sh && chmod +x /start.sh
31
+
32
+ EXPOSE 7860
33
+ USER 1000
34
+ CMD ["/start.sh"]