Skip to content

Commit

Permalink
Merge pull request geekan#16 from sablin39/main
Browse files Browse the repository at this point in the history
Adding a Dockerfile for docker implementation
  • Loading branch information
geekan authored Jul 9, 2023
2 parents 3882416 + 559a5f4 commit 37902e4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.9.17-slim-bullseye

#Special gifts for mainland China users :)
#Change to your own preferenced mirrors if you wish, just uncomment them is fine too.
#Below is apt mirror setup.
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list &&\
apt update &&\
apt install -y git curl wget build-essential gcc clang g++ make &&\
curl -sL https://deb.nodesource.com/setup_19.x | bash - &&\
apt install -y nodejs


WORKDIR /app
#This sets npm mirror url.
RUN npm config set registry https://registry.npm.taobao.org &&\
npm install -g @mermaid-js/mermaid-cli &&\
git clone https://github.com/geekan/metagpt
RUN cd metagpt &&\
mkdir workspace &&\
#This sets the pip mirror url.
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ &&\
pip install -r requirements.txt --no-cache-dir &&\
python setup.py install

RUN pip cache purge &&\
apt autoclean


18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,24 @@ cp config/config.yaml config/key.yaml
| OPENAI_API_KEY # Replace with your own key | OPENAI_API_KEY: "sk-..." | export OPENAI_API_KEY="sk-..." |
| OPENAI_API_BASE # Optional | OPENAI_API_BASE: "https://<YOUR_SITE>/v1" | export OPENAI_API_BASE="https://<YOUR_SITE>/v1" |

## Docker Setup

You can also use docker to setup MetaGPT.
```bash
cd metagpt
docker build --network host -t metagpt:<version> .
```
There are some changes of mirrors in the dockerfile, for users outside mainland China, feel free to modify or delete them :)

You can also pull the image from dockerhub via `docker pull sablin39/metagpt:<TAG>`.

To run the docker image, you can use the following command.
```bash
docker run -it -v <MetaGPT-config-dir>:/app/metagpt/config -v <Workspace-dir>:/app/metagpt/workspace metagpt:<version> <command>
```
This command mounts the `config` and `workspace` folder in the host machine. You should use absolute directory of these folders.


## Tutorial: Initiating a startup

```shell
Expand Down

0 comments on commit 37902e4

Please sign in to comment.