-
Notifications
You must be signed in to change notification settings - Fork 44.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve docker setup & config (#1843)
* Improve docker setup & config * fix(browsing): Selenium needs access to home directory * fix(docker): allow overriding memory backend settings * simplify Dockerfile and docker-compose config * add .dockerignore * adjust Docker CI with release build type arg * replace Chrome by Chromium in devcontainer * update docs * update bulletin * use preinstalled chromedriver in web_selenium.py * update installation.md * fix code blocks for mkdocs * fix links to docs
- Loading branch information
Showing
10 changed files
with
136 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.* | ||
*.template | ||
*.yaml | ||
*.yml | ||
|
||
*.md | ||
*.png | ||
!BULLETIN.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
Welcome to Auto-GPT! We'll keep you informed of the latest news and features by printing messages here. | ||
If you don't wish to see this message, you can run Auto-GPT with the --skip-news flag | ||
If you don't wish to see this message, you can run Auto-GPT with the --skip-news flag | ||
|
||
## Changes to Docker configuration | ||
The workdir has been changed from /home/appuser to /app. Be sure to update any volume mounts accordingly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,33 @@ | ||
# Use an official Python base image from the Docker Hub | ||
FROM python:3.10-slim | ||
|
||
# Install git | ||
RUN apt-get -y update | ||
RUN apt-get -y install git chromium-driver | ||
# 'dev' or 'release' container build | ||
ARG BUILD_TYPE=dev | ||
|
||
# Install Xvfb and other dependencies for headless browser testing | ||
RUN apt-get update \ | ||
&& apt-get install -y wget gnupg2 libgtk-3-0 libdbus-glib-1-2 dbus-x11 xvfb ca-certificates | ||
# Install browsers | ||
RUN apt-get update && apt-get install -y \ | ||
chromium-driver firefox-esr \ | ||
ca-certificates | ||
|
||
# Install Firefox / Chromium | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ | ||
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y chromium firefox-esr | ||
# Install utilities | ||
RUN apt-get install -y curl jq wget git | ||
|
||
# Set environment variables | ||
ENV PIP_NO_CACHE_DIR=yes \ | ||
PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
# Create a non-root user and set permissions | ||
RUN useradd --create-home appuser | ||
WORKDIR /home/appuser | ||
RUN chown appuser:appuser /home/appuser | ||
USER appuser | ||
# 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 sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \ | ||
pip install --no-cache-dir --user -r requirements.txt | ||
# Only install dev dependencies in dev container builds | ||
RUN [ '${BUILD_TYPE}' = 'dev' ] || sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the application files | ||
COPY --chown=appuser:appuser autogpt/ ./autogpt | ||
WORKDIR /app | ||
COPY autogpt/ ./autogpt | ||
|
||
# Set the entrypoint | ||
ENTRYPOINT ["python", "-m", "autogpt"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters