Sign inSign up

ceramicwhite/auto-gpt

By ceramicwhite

Updated about 3 years ago

Significant-Gravitas/Auto-GPT + gotty + ability to auto install plugins

Image
47

10K+

ceramicwhite/auto-gpt repository overview

Update
Added an entrypoint script that makes a couple new ENVs available
  1. GPT3_ONLY=
    1. false (default)
    2. true
  2. PLUGINS=
    1. user/repo
    2. example: PLUGINS=hdkiller/Auto-GPT-SystemInfo,Wladastic/Auto-GPT-Telegram-Plugin,isaiahbjork/Auto-GPT-MetaTrader-Plugin
  3. PLUGINS_REQS=
    1. some plugins require addition packages outside of whats specified in requirements add them to this env and it will first try pip and then apt
    2. example: PLUGINS_REQS=ta,build-essential
Docker Compose:
curl -sSL https://raw.githubusercontent.com/ceramicwhite/Auto-GPT/master/.github/workflows/dockerfiles/docker-compose.yml > docker-compose.yml

#Add your OpenAI API key to the docker-compose.yml, then run:

docker compose up -d

Then access at:

http://localhost:3000

docker-compose.yml

version: "3.9"

services:
  auto-gpt:
    image:  ceramicwhite/auto-gpt:latest
    restart: on-failure
    init: true
    stop_grace_period: 1m
    tty: true
    #env_file:
    #  - .env
    environment:
      - OPENAI_API_KEY=<your-open-api-key>
      #- GPT3_ONLY=TRUE
      ###### Redis ############
      - MEMORY_BACKEND=redis
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=autogpt12345
      - WIPE_REDIS_ON_START=False
      - MEMORY_INDEX=auto-gpt
      ####### Optional ##########
      #- PLUGINS=hdkiller/Auto-GPT-SystemInfo
      #- PLUGINS_REQS=build-essential
      #- GOOGLE_API_KEY=<your-google-api-key>
      #- CUSTOM_SEARCH_ENGINE_ID=<your-google-custom-search-id>
      #- ELEVENLABS_API_KEY=<your-elevan-labs-api-key> 
      #- ELEVENLABS_VOICE_1_ID=your-voice-id-1
    volumes:
      - ./data/auto_gpt_workspace:/app/autogpt/auto_gpt_workspace:rw
      - ./data/logs/auto-gpt:/app/logs:rw
    depends_on:
      - redis
    ports:
      - 3000:3000

  redis:
    container_name: redis
    image: "redis/redis-stack-server:latest"
    restart: on-failure
    stop_grace_period: 5m
    environment:
      - REDIS_ARGS=--requirepass autogpt12345
    volumes:
      - ./data/redis:/data:rw

networks:
    default:
      name: auto-gpt
Dockerfile:
ARG GIT_TAG=${GIT_TAG:-master}

FROM python:3.10-slim AS app

ARG GIT_TAG

COPY --from=ceramicwhite/gotty /usr/bin/gotty /bin/gotty

ENV PIP_NO_CACHE_DIR=yes \
    PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    HEADLESS_BROWSER=True \
    EXECUTE_LOCAL_COMMANDS=True \
    HOME=/app \
    PATH="${PATH}:/app/.local/bin"

WORKDIR /app

RUN apt-get -y update && \
    apt-get -y install \
    git \
    wget \
    curl \
    jq \
    sudo \
    unzip \
    chromium-driver \
    firefox-esr \
    ca-certificates && \
    git clone -b ${GIT_TAG} --depth 1 https://github.com/Significant-Gravitas/Auto-GPT.git . && \
    pip install --upgrade pip ; \
    if [ "${GIT_TAG}" != "master" ]; then \
        sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt; \
    fi ; \
    pip install --no-cache-dir -r requirements.txt && \
    curl -L -o ./entrypoint.sh https://raw.githubusercontent.com/ceramicwhite/Auto-GPT/master/.github/workflows/dockerfiles/entrypoint.sh && \
    chmod +x entrypoint.sh

EXPOSE 3000

ENTRYPOINT ["/app/entrypoint.sh"]
entrypoint.sh:
#!/bin/bash

set -e

PLUGINS_PATH="/app/plugins"

# Ensure the plugins directory exists
mkdir -p ${PLUGINS_PATH}

if [ -z "$PLUGINS" ]
then
      echo "No plugins specified. Skipping download."
else
    # Split the plugins list into an array
    IFS=',' read -r -a plugin_array <<< "$PLUGINS"

    # Download each plugin
    for element in "${plugin_array[@]}"
    do
        # Extract the plugin name from the string (everything after the last /)
        PLUGIN_NAME=$(basename "$element")
        # Form the full URL
        FULL_URL="https://github.com/${element}/archive/refs/heads/master.zip"
        # Download the plugin
        curl -L -o ${PLUGINS_PATH}/"${PLUGIN_NAME}".zip "$FULL_URL"
    done

    # Check if /app/.env exists, if not, create it
    if [ ! -f /app/.env ]
    then
        touch /app/.env
    fi

    # Install plugin dependencies
    python -m scripts.install_plugin_deps
fi

# Install plugin requirements
if [ ! -z "$PLUGINS_REQS" ]
then
    # Split the requirements list into an array
    IFS=',' read -r -a reqs_array <<< "$PLUGINS_REQS"

    # Install each requirement
    for element in "${reqs_array[@]}"
    do
        echo "Installing $element"
        if pip install --no-cache-dir "$element"; then
            echo "Installed $element with pip"
        elif apt-get -y install "$element"; then
            echo "Installed $element with apt-get"
        else
            echo "Failed to install $element"
        fi
    done
fi

# Base command
COMMAND=("gotty" "--port" "3000" "--permit-write" "--title-format" "AutoGPT Terminal" "python" "-m" "autogpt")

# Check GPT3_ONLY environment variable
if [ "$GPT3_ONLY" = true ]
then
    COMMAND+=("--gpt3only")
fi

# Execute the original ENTRYPOINT with all arguments
exec "${COMMAND[@]}"

Tag summary

Content type

Image

Digest

sha256:dea91226e

Size

622.9 MB

Last updated

about 3 years ago

docker pull ceramicwhite/auto-gpt