Update Dockerfile
Browse files- Dockerfile +24 -5
Dockerfile
CHANGED
|
@@ -1,12 +1,31 @@
|
|
| 1 |
FROM agent0ai/agent-zero:latest
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
# Variables de entorno para RFC (personalízalas en Secrets si quieres)
|
| 6 |
ENV RFC_PASSWORD="default_password_change_me" \
|
| 7 |
A0_SET_RFC_URL="localhost" \
|
| 8 |
A0_SET_RFC_PORT_HTTP=55080
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM agent0ai/agent-zero:latest
|
| 2 |
|
| 3 |
+
USER root
|
| 4 |
+
|
| 5 |
+
# Crear usuario no root UID 1000
|
| 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 |
ENV RFC_PASSWORD="default_password_change_me" \
|
| 12 |
A0_SET_RFC_URL="localhost" \
|
| 13 |
A0_SET_RFC_PORT_HTTP=55080
|
| 14 |
|
| 15 |
+
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
USER 1000
|
| 18 |
+
|
| 19 |
+
# Buscar el intérprete de Python dentro del entorno virtual de la imagen oficial
|
| 20 |
+
# y ejecutar run_ui.py con los argumentos correctos.
|
| 21 |
+
CMD ["/bin/bash", "-c", " \
|
| 22 |
+
if [ -f /a0/venv/bin/python ]; then \
|
| 23 |
+
PYTHON=/a0/venv/bin/python; \
|
| 24 |
+
elif [ -f /git/agent-zero/venv/bin/python ]; then \
|
| 25 |
+
PYTHON=/git/agent-zero/venv/bin/python; \
|
| 26 |
+
else \
|
| 27 |
+
echo 'No se encontró el entorno virtual'; exit 1; \
|
| 28 |
+
fi; \
|
| 29 |
+
cd /git/agent-zero; \
|
| 30 |
+
exec $PYTHON run_ui.py --host 0.0.0.0 --port 7860 --dockerized=True \
|
| 31 |
+
"]
|