diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2023-12-08 15:43:10 +0100 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2023-12-08 15:43:36 +0100 |
commit | f3faa478144759bed4ba23e2865915d0b319a4b8 (patch) | |
tree | 483aafbd69d88305de43589b0d24b2eb67357913 | |
parent | fix(agent): Fix type issues with agent ID and apply_overrides_to_ai_settings (diff) | |
download | Auto-GPT-f3faa478144759bed4ba23e2865915d0b319a4b8.tar.gz Auto-GPT-f3faa478144759bed4ba23e2865915d0b319a4b8.tar.bz2 Auto-GPT-f3faa478144759bed4ba23e2865915d0b319a4b8.zip |
build: Reduce AutoGPT Docker image size
- Removed firefox-esr package to reduce image size
- Added --no-cache flag to poetry install steps
- Removed source code files after installation to reduce image size
-rw-r--r-- | autogpts/autogpt/Dockerfile | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/autogpts/autogpt/Dockerfile b/autogpts/autogpt/Dockerfile index 941620e8b..b7af437a8 100644 --- a/autogpts/autogpt/Dockerfile +++ b/autogpts/autogpt/Dockerfile @@ -6,7 +6,7 @@ FROM python:3.10-slim AS autogpt-base # Install browsers RUN apt-get update && apt-get install -y \ - chromium-driver firefox-esr ca-certificates gcc \ + chromium-driver ca-certificates gcc \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Install utilities @@ -37,12 +37,14 @@ CMD [] # dev build -> include everything FROM autogpt-base as autogpt-dev -RUN poetry install --no-root +RUN poetry install --no-cache --no-root \ + && rm -rf $(poetry env info --path)/src ONBUILD COPY . ./ # release build -> include bare minimum FROM autogpt-base as autogpt-release -RUN poetry install --no-root --without dev +RUN poetry install --no-cache --no-root --without dev \ + && rm -rf $(poetry env info --path)/src ONBUILD COPY autogpt/ ./autogpt ONBUILD COPY scripts/ ./scripts ONBUILD COPY plugins/ ./plugins |