-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
72 lines (48 loc) · 2.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#version7
ARG GOTTY_VERSION=v1.5.0
# Some parts copied from https://github.com/claytondukes/autogpt-docker/blob/main/Dockerfile and https://github.com/Significant-Gravitas/Auto-GPT/blob/master/Dockerfile
FROM debian:stable AS builder
ARG GOTTY_VERSION
WORKDIR /build
#grab gotty
ADD https://github.com/sorenisanerd/gotty/releases/download/${GOTTY_VERSION}/gotty_${GOTTY_VERSION}_linux_arm64.tar.gz gotty-aarch64.tar.gz
ADD https://github.com/sorenisanerd/gotty/releases/download/${GOTTY_VERSION}/gotty_${GOTTY_VERSION}_linux_amd64.tar.gz gotty-x86_64.tar.gz
#unzip gotty
RUN tar -xzvf "gotty-$(uname -m).tar.gz"
#install git for builder
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get -y install git
#Clone Auto-GPT github stable
RUN git clone -b stable https://github.com/Significant-Gravitas/Auto-GPT.git
# Use an official Python base image from the Docker Hub
FROM python:3.10-slim
#Copy gotty from builder
COPY --chmod=+x --from=builder /build/gotty /bin/gotty
# Install Firefox / Chromium
RUN apt-get update && apt-get install -y \
chromium-driver firefox-esr \
ca-certificates
# Install utilities
RUN apt-get install -y curl jq wget git nano
# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
COMMAND_LINE_PARAMS=${COMMAND_LINE_PARAMS}
# Install the required python packages globally
ENV PATH="$PATH:/root/.local/bin"
COPY requirements.txt .
# Copy the requirements.txt file and install the requirements
COPY --chown=appuser:appuser requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache-dir --user -r requirements.txt
# Copy the application files
WORKDIR /app
COPY --from=builder /build/Auto-GPT/ /app
RUN curl -L -o ./plugins/Auto-GPT-Plugins.zip https://github.com/Significant-Gravitas/Auto-GPT-Plugins/archive/refs/heads/master.zip
RUN wget https://raw.githubusercontent.com/ther3zz/autogpt_gotty/main/plugins_config.yaml
EXPOSE 8080
# Set the entrypoint
WORKDIR /app
CMD ["gotty", "--port", "8080", "--permit-write", "--title-format", "AutoGPT Terminal", "bash", "-c", "python -m autogpt --install-plugin-deps ${COMMAND_LINE_PARAMS}"]