From 0fe90010e06bfa4d28054cd4163208353b99d7dd Mon Sep 17 00:00:00 2001 From: Nicholas Albion Date: Thu, 19 Oct 2023 18:15:26 +1100 Subject: [PATCH] #228 - mount local directory into Docker container. --- README.md | 11 ++++++----- docker-compose.yml | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d37b7c35..d732bc36 100644 --- a/README.md +++ b/README.md @@ -83,11 +83,12 @@ All generated code will be stored in the folder `workspace` inside the folder na ## 🐳 How to start gpt-pilot in docker? 1. `git clone https://github.com/Pythagora-io/gpt-pilot.git` (clone the repo) 2. Update the `docker-compose.yml` environment variables, which can be done via `docker compose config` . if you use local model, please go to [https://localai.io/basics/getting_started/](https://localai.io/basics/getting_started/) start. -3. run `docker compose build`. this will build a gpt-pilot container for you. -4. run `docker compose up`. -5. access the web terminal on `port 7681` -6. `python db_init.py` (initialize the database) -7. `python main.py` (start GPT Pilot) +3. By default, GPT Pilot will read & write to `~/gpt-pilot-workspace` on your machine, you can also edit this in `docker-compose.yml` +4. run `docker compose build`. this will build a gpt-pilot container for you. +5. run `docker compose up`. +6. access the web terminal on `port 7681` +7. `python db_init.py` (initialize the database) +8. `python main.py` (start GPT Pilot) This will start two containers, one being a new image built by the `Dockerfile` and a Postgres database. The new image also has [ttyd](https://github.com/tsl0922/ttyd) installed so that you can easily interact with gpt-pilot. Node is also installed on the image and port 3000 is exposed. diff --git a/docker-compose.yml b/docker-compose.yml index df7e4edc..44c0ac40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,8 @@ services: - DB_PORT=5432 - DB_USER=pilot - DB_PASSWORD=pilot + volumes: + - ~/gpt-pilot-workspace:/usr/src/app/workspace build: context: . dockerfile: Dockerfile