Skip to content

Commit

Permalink
touch ups to docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
chemik-bit committed Mar 22, 2024
1 parent dc701cb commit b6cd690
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 20 deletions.
84 changes: 69 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,32 +213,86 @@ For more detailed installation steps along with the reasons for doing each pleas
Finally, for use of SalesGPT create an `.env` file just as our `.env.example` and put your API keys there by specifying a new line just as we have done.

## Run an Example AI Sales agent
If you used a local installation of SalesGPT skip the next two steps and directly run either script:

`git clone https://github.com/filip-michalsky/SalesGPT.git`
Navigate into the SalesGPT directory:

`cd SalesGPT`

### Docker utilization
If you have Docker installed or would prefer to use Docker, follow these simple steps:
Before proceeding with the Docker steps, ensure you have Docker installed on your system. If not, please follow the installation instructions on the [official Docker website](https://docs.docker.com/get-docker/).
SalesGPT can be run in various ways, tailored to your preferences and setup. Below are the methods available:

### 1. Using Docker
For those who prefer containerization, Docker offers an isolated and consistent environment. Ensure Docker is installed on your system by following the [official Docker installation guide](https://docs.docker.com/get-docker/).

To run SalesGPT with Docker, execute the following steps:

1. **Start the Application with Docker Compose:**

Use the command below to start SalesGPT in detached mode:
```
docker-compose up -d
```
If you've made changes and want them to reflect, append `--build` to the command above.

2. **Stopping the Application:**

To stop and remove all running containers related to SalesGPT, execute:
```
docker-compose down
```

**Troubleshooting:**

- **Clean Up Docker Resources:** If you encounter errors, you can clean up Docker by removing all unused containers, networks, images, and volumes with caution:
```
docker system prune --volumes
```
- **Rebuild Without Cache:** To rebuild and start the services afresh without using cache, run:
```
docker-compose up -d --build --no-cache
```

After successful setup, access SalesGPT at [localhost:3000/chat](http://localhost:3000/chat) in your browser.

### 2. Direct User Interface Launch
If Docker is not part of your workflow, you can directly launch the SalesGPT user interface. Please refer to the `README.md` file in the frontend directory for instructions on setting up the UI locally.

### 3. Using the Terminal
For terminal enthusiasts or automation scripts, run SalesGPT with the following command:
`python run.py --verbose True --config examples/example_agent_setup.json`

### 4.
### 4. Running Only the Backend
For those who wish to integrate SalesGPT's backend with their own user interface or application, running only the backend is a straightforward process. This allows you to leverage the powerful features of SalesGPT while maintaining full control over the user experience.

To run only the backend of SalesGPT, follow these steps:
1. **Start the Backend Service:**

Use the following command to start the backend service. This will initiate the server on port 8000 by default, making the API accessible:
```
docker-compose up -d backend
```

If you need to rebuild the backend image, perhaps after making changes, you can add `--build` to the command above.

2. **Accessing the Backend:**

1. Clone the SalesGPT Github repository:
With the backend running, you can access the API endpoints at `http://localhost:8000`. Refer to the API documentation for details on available endpoints and their usage.

`git clone https://github.com/filip-michalsky/SalesGPT.git`
3. **Stopping the Backend:**

2. Navigate to the SalesGPT directory:
To stop the backend service, execute:
```
docker-compose stop backend
```

`cd SalesGPT`
If you wish to remove the backend container entirely, use:
```
docker-compose down
```

3. Run the application using Docker Compose:
This setup is ideal for developers looking to integrate SalesGPT's backend into custom applications or those who prefer to use a different frontend technology.

`docker-compose up`

This will build and start the necessary Docker containers for SalesGPT. You can then access the application by opening the following link in any of your browsers: [localhost:3000/chat](http://localhost:3000/chat)

### Direct user interface launch
If you do not have Docker installed please use the README.md file in the frontend directory to launch the user interface.

## Test your setup

Expand Down
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r requirements.txt
pytest>=7.4.3
pytest-cov>=4.1.0
pytest-asyncio>=0.23.1
6 changes: 1 addition & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ tiktoken>=0.5.2
pydantic>=2.5.2
litellm>=1.10.2
ipykernel>=6.27.1
pytest>=7.4.3
pytest-cov>=4.1.0
pytest-asyncio>=0.23.1
langchain-openai==0.0.2

langchain-openai==0.0.2

0 comments on commit b6cd690

Please sign in to comment.