Skip to content

Agent Zero AI framework

Dockerfile updates

frdel9d1d2be89717
diff --git a/docker/run/Dockerfile b/docker/run/Dockerfile
index c38b778c6..1bb53a946 100644
--- a/docker/run/Dockerfile
+++ b/docker/run/Dockerfile
@@ -1,13 +1,12 @@
# Use the latest slim version of Debian
-FROM --platform=$TARGETPLATFORM debian:bookworm-slim
-
-# Set ARG for platform-specific commands
-ARG TARGETPLATFORM
+FROM debian:bookworm-slim
# Update and install necessary packages
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
+ python3-dev \
+ python3-babel \
python3-venv \
nodejs \
npm \
@@ -16,7 +15,8 @@ RUN apt-get update && apt-get install -y \
curl \
wget \
git \
- ffmpeg
+ build-essential \
+ ffmpeg
# Cleanup package list
RUN rm -rf /var/lib/apt/lists/*
@@ -26,40 +26,15 @@ RUN mkdir /var/run/sshd && \
echo 'root:toor' | chpasswd && \
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
-# Create and activate Python virtual environment
-ENV VIRTUAL_ENV=/opt/venv
-RUN python3 -m venv $VIRTUAL_ENV
-
-# Copy contents of filesystem directory to /
+# Copy contents of the project to /a0
COPY ./fs/ /
-# Ensure the virtual environment and pip setup
-RUN $VIRTUAL_ENV/bin/pip install --upgrade pip
-
-# Install additional python packages
-RUN $VIRTUAL_ENV/bin/pip install \
- ipython \
- requests
-
-# Clone Agent Zero repository
-RUN git clone --branch development https://github.com/frdel/agent-zero.git /git/agent-zero
-
-# Install A0 python packages
-RUN $VIRTUAL_ENV/bin/pip install -r /git/agent-zero/requirements.txt
-# Preload A0
-RUN $VIRTUAL_ENV/bin/python /git/agent-zero/preload.py
-
-
-
-# Clone additional git repos
-RUN git clone https://github.com/searxng/searxng.git /git/searxng
-
+# install a0
+RUN bash /ins/install_A0.sh
# install additional software
RUN bash /ins/install_searxng.sh
-
-
# Expose ports
EXPOSE 22 80
diff --git a/docker/run/fs/exe/run_A0.sh b/docker/run/fs/exe/run_A0.sh
index 0da64a97f..7e3e81e63 100644
--- a/docker/run/fs/exe/run_A0.sh
+++ b/docker/run/fs/exe/run_A0.sh
@@ -26,11 +26,11 @@ while true; do
setup_venv
- # Copy repository files if target is empty
- if [ -z "$(ls -A "$TARGET_DIR")" ]; then
- echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
- cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
- fi
+ # # Copy repository files if target is empty
+ # if [ -z "$(ls -A "$TARGET_DIR")" ]; then
+ # echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
+ # cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
+ # fi
echo "Starting A0..."
python /a0/run_ui.py \
diff --git a/docker/run/fs/ins/install_A0.sh b/docker/run/fs/ins/install_A0.sh
new file mode 100644
index 000000000..f34c54cd7
--- /dev/null
+++ b/docker/run/fs/ins/install_A0.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+BRANCH="development"
+
+git clone -b "$BRANCH" "https://github.com/frdel/agent-zero" "/a0"
+
+# Create and activate Python virtual environment
+python3 -m venv /opt/venv
+source /opt/venv/bin/activate
+
+# Ensure the virtual environment and pip setup
+pip install --upgrade pip ipython requests
+
+# Install A0 python packages
+pip install -r /a0/requirements.txt
+
+# Preload A0
+python /a0/preload.py
diff --git a/docker/run/fs/ins/install_searxng.sh b/docker/run/fs/ins/install_searxng.sh
index ac76a30da..8edf0aaa4 100644
--- a/docker/run/fs/ins/install_searxng.sh
+++ b/docker/run/fs/ins/install_searxng.sh
@@ -14,4 +14,4 @@ sudo -H mkdir "/usr/local/searxng"
sudo -H chown -R "searxng:searxng" "/usr/local/searxng"
# Start a new shell from new created user and clone SearXNG:
-sudo -H -u searxng -i bash /ins/install_searxng_user.sh
+sudo -H -u searxng -i bash /ins/install_searxng2.sh
diff --git a/docker/run/fs/ins/install_searxng_user.sh b/docker/run/fs/ins/install_searxng2.sh
similarity index 81%
rename from docker/run/fs/ins/install_searxng_user.sh
rename to docker/run/fs/ins/install_searxng2.sh
index 0bc2132bf..a75ffc5fe 100644
--- a/docker/run/fs/ins/install_searxng_user.sh
+++ b/docker/run/fs/ins/install_searxng2.sh
@@ -3,7 +3,11 @@
# clone SearXNG repo
# git clone "https://github.com/searxng/searxng" \
# "/usr/local/searxng/searxng-src"
-cp -r "/git/searxng" "/usr/local/searxng/searxng-src"
+
+# cp -r "/git/searxng" "/usr/local/searxng/searxng-src"
+
+git clone "https://github.com/searxng/searxng" \
+ "/usr/local/searxng/searxng-src"
# create virtualenv:
python3 -m venv "/usr/local/searxng/searx-pyenv"