Dockerfile updates
frdel committed
Nov 18, 2024 at 16:18 UTC
9d1d2be89717994bcd5323b0cd418728d31b98cb
5 files changed
+37
-40
docker/run/Dockerfile
+8
-33
@@ -1,13 +1,12 @@
1
# Use the latest slim version of Debian
2
-FROM --platform=$TARGETPLATFORM debian:bookworm-slim
3
-
4
-# Set ARG for platform-specific commands
5
-ARG TARGETPLATFORM
2
+FROM debian:bookworm-slim
3
4
# Update and install necessary packages
5
RUN apt-get update && apt-get install -y \
6
python3 \
7
python3-pip \
8
+ python3-dev \
9
+ python3-babel \
10
python3-venv \
11
nodejs \
12
npm \
@@ -16,7 +15,8 @@ RUN apt-get update && apt-get install -y \
15
curl \
16
wget \
17
git \
19
- ffmpeg
18
+ build-essential \
19
+ ffmpeg
20
21
# Cleanup package list
22
RUN rm -rf /var/lib/apt/lists/*
@@ -26,40 +26,15 @@ RUN mkdir /var/run/sshd && \
26
echo 'root:toor' | chpasswd && \
27
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
28
29
-# Create and activate Python virtual environment
30
-ENV VIRTUAL_ENV=/opt/venv
31
-RUN python3 -m venv $VIRTUAL_ENV
32
-
33
-# Copy contents of filesystem directory to /
29
+# Copy contents of the project to /a0
30
COPY ./fs/ /
31
36
-# Ensure the virtual environment and pip setup
37
-RUN $VIRTUAL_ENV/bin/pip install --upgrade pip
38
-
39
-# Install additional python packages
40
-RUN $VIRTUAL_ENV/bin/pip install \
41
- ipython \
42
- requests
43
-
44
-# Clone Agent Zero repository
45
-RUN git clone --branch development https://github.com/frdel/agent-zero.git /git/agent-zero
46
-
47
-# Install A0 python packages
48
-RUN $VIRTUAL_ENV/bin/pip install -r /git/agent-zero/requirements.txt
49
-# Preload A0
50
-RUN $VIRTUAL_ENV/bin/python /git/agent-zero/preload.py
51
-
52
-
53
-
54
-# Clone additional git repos
55
-RUN git clone https://github.com/searxng/searxng.git /git/searxng
56
-
32
+# install a0
33
+RUN bash /ins/install_A0.sh
34
35
# install additional software
36
RUN bash /ins/install_searxng.sh
37
61
-
62
-
38
# Expose ports
39
EXPOSE 22 80
40
docker/run/fs/exe/run_A0.sh
+5
-5
@@ -26,11 +26,11 @@ while true; do
26
27
setup_venv
28
29
- # Copy repository files if target is empty
30
- if [ -z "$(ls -A "$TARGET_DIR")" ]; then
31
- echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
32
- cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
33
- fi
29
+ # # Copy repository files if target is empty
30
+ # if [ -z "$(ls -A "$TARGET_DIR")" ]; then
31
+ # echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
32
+ # cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
33
+ # fi
34
35
echo "Starting A0..."
36
python /a0/run_ui.py \
docker/run/fs/ins/install_A0.sh
new
+18
@@ -0,0 +1,18 @@
1
+#!/bin/bash
2
+
3
+BRANCH="development"
4
+
5
+git clone -b "$BRANCH" "https://github.com/frdel/agent-zero" "/a0"
6
+
7
+# Create and activate Python virtual environment
8
+python3 -m venv /opt/venv
9
+source /opt/venv/bin/activate
10
+
11
+# Ensure the virtual environment and pip setup
12
+pip install --upgrade pip ipython requests
13
+
14
+# Install A0 python packages
15
+pip install -r /a0/requirements.txt
16
+
17
+# Preload A0
18
+python /a0/preload.py
docker/run/fs/ins/install_searxng.sh
+1
-1
@@ -14,4 +14,4 @@ sudo -H mkdir "/usr/local/searxng"
14
sudo -H chown -R "searxng:searxng" "/usr/local/searxng"
15
16
# Start a new shell from new created user and clone SearXNG:
17
-sudo -H -u searxng -i bash /ins/install_searxng_user.sh
17
+sudo -H -u searxng -i bash /ins/install_searxng2.sh
docker/run/fs/ins/install_searxng2.sh
renamed
+5
-1
@@ -3,7 +3,11 @@
3
# clone SearXNG repo
4
# git clone "https://github.com/searxng/searxng" \
5
# "/usr/local/searxng/searxng-src"
6
-cp -r "/git/searxng" "/usr/local/searxng/searxng-src"
6
+
7
+# cp -r "/git/searxng" "/usr/local/searxng/searxng-src"
8
+
9
+git clone "https://github.com/searxng/searxng" \
10
+ "/usr/local/searxng/searxng-src"
11
12
# create virtualenv:
13
python3 -m venv "/usr/local/searxng/searx-pyenv"