Repository: Significant-Gravitas/AutoGPT
Pull request: Fix docker volume mounts
This is a quick-fix fixing #1513 


### Background
the Issue itself is that the release container is build only including "autogpt", while the documentations docker-compose.yml is trying to mount the local dir assuming its the source dir - which for most users wont be the case, thus the mount will overwrite the containers /app path with whats in local dir (not finding the autogpt module) and if its not mounted the scripts folder is missing.

### Changes
this commit adresses both issues by adjusting the docker-compose.yml in the docs, as well as the Dockerfile to include scripts.

Now, this still creates a setup that wont be ideal for most users as they will struggle to get plugins and their dependencies in etc. it might make sense to provide an official project-template, similar, probably slightly adjusted to use official images, https://github.com/ppetermann/Auto-GPT-DockerSetup

(if needed I can help maintaining something) 


### PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] I have thoroughly tested my changes with multiple different prompts.
- [x] I have considered potential risks and mitigations for my changes.
- [x] I have documented my changes clearly and comprehensively.
- [x] I have not snuck in any "extra" small tweaks changes

Problem statement:
Unable to run built docker container: No module named autogpt
### Duplicates

- [X] I have searched the existing issues

### Steps to reproduce 🕹

Docker buidl goes perfectly fine, albeit with a lot of warning..

 
docker run -it --env-file=./.env -v ~/auto_gpt_workspace:/app/auto_gpt_workspace autogpt

gives back:

/usr/local/bin/python: No module named autogpt


I have followed the README exactly. This is a checked out master from some minutes ago.

### Current behavior 😯

/usr/local/bin/python: No module named autogpt

### Expected behavior 🤔

It should just run, right?

### Your prompt 📝

```yaml
# Paste your prompt here
```

Hints from issue discussion:
The fix is on the way with #1425
[Fixed](https://github.com/Significant-Gravitas/Auto-GPT/pull/1516)

edit: oops possibly duplicate by #1425 
I just encountered this today after trying to run with Docker (latest).
I reverted from 0.3 to 0.2.2 and it works. Didn't really dig in much past that, but might be worth somebody checking that the fix didn't get reverted in this new release...
I'm not able to reproduce your error with 0.3.0 on Linux. Are you using macOS?

![image](https://user-images.githubusercontent.com/45949667/235755085-fec30543-63ab-4f68-8ec0-e17a7e4c3611.png)

I'm on Windows
I'm getting the same error on Windows running on Docker latest version:

"/usr/local/bin/python: No module named autogpt"
@badcom @M00NSH0T what *exact* command are you trying to use to start it?  (the one in the original ticket is not using windows pathes)
happens when I run `docker-compose run --rm auto-gpt` in the directory with the .env and docker-compose.yml files.
@M00NSH0T is that the root directory of auto-gpt 0.3.0, or do you have those files in a different directory?

Commit message: this addresses the issues mentioned in #1513

Patch to review:
diff --git a/Dockerfile b/Dockerfile
index 6023cefac6ae..d32d4a667d4a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -36,5 +36,7 @@ RUN sed -i '/Items below this point will not be included in the Docker Image/,$d
 	pip install --no-cache-dir -r requirements.txt
 WORKDIR /app
 ONBUILD COPY autogpt/ ./autogpt
+ONBUILD COPY scripts/ ./scripts
+
 
 FROM autogpt-${BUILD_TYPE} AS auto-gpt
diff --git a/docs/setup.md b/docs/setup.md
index d0917c8bfc78..c3ef7136c8d7 100644
--- a/docs/setup.md
+++ b/docs/setup.md
@@ -54,8 +54,6 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt
             environment:
               MEMORY_BACKEND: ${MEMORY_BACKEND:-redis}
               REDIS_HOST: ${REDIS_HOST:-redis}
-            volumes:
-              - ./:/app
             profiles: ["exclude-from-up"]
           redis:
             image: "redis/redis-stack-server:latest"


Code review comments:
diff_hunk: @@ -54,8 +54,6 @@ Get your OpenAI API key from: [https://platform.openai.com/account/api-keys](htt
             environment:
               MEMORY_BACKEND: ${MEMORY_BACKEND:-redis}
               REDIS_HOST: ${REDIS_HOST:-redis}
-            volumes:
-              - ./:/app
path: docs/setup.md
text: @user1:
Needs volume mounts for `auto_gpt_workspace`, `logs`, `auto-gpt.json`, `ai_settings.yaml`, `azure.yaml`, `CURRENT_BULLETIN.md`, some of them commented out so people can activate them when they need them.

@author:
sure, can add, none of them are hard needed though

@author:
mh, mounting CURRENT_BULLETIN.md doesn't make sense, makes more sense to bake that into the Dockerfile


@user1:
> sure, can add, none of them are hard needed though

`auto_gpt_workspace`, `logs`, and `azure.yaml` at the very least are pretty essential to be able to make full use of the application.

> makes more sense to bake that into the Dockerfile

Absolutely not, that misses the whole point of the file.

@author:
ok? because nobody is gonna update it in the runtime folder? 
if its the bulletin with the release -> dockerfile
if its pulled during startup -> why mount?

why is azure.yml essential, what am I missing?

i'm gonna skip auto-gpt.json, as that should be covered by using redis?


@user1:
> if its pulled during startup -> why mount?

Because the instructions say to run with `--rm`, meaning it won't be persisted in the container, and if it isn't mounted and persisted that way, the bulletin will show up as "new" on every run.

> why is azure.yml essential, what am I missing?

It is essential to users who use Azure.

> i'm gonna skip auto-gpt.json, as that should be covered by using redis?

yup