diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..29f664e97 --- /dev/null +++ b/Dockerfile @@ -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 + + diff --git a/README.md b/README.md index 6c2175822..748dee94f 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,24 @@ # Copy the configuration file and make the necessary modifications. | 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:///v1" | export OPENAI_API_BASE="https:///v1" | +## Docker Setup + +You can also use docker to setup MetaGPT. +```bash +cd metagpt +docker build --network host -t metagpt: . +``` +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:`. + +To run the docker image, you can use the following command. +```bash +docker run -it -v :/app/metagpt/config -v :/app/metagpt/workspace metagpt: +``` +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