Skip to content

Commit

Permalink
README: Update to use docker-compose (#12)
Browse files Browse the repository at this point in the history
Update to show how to use docker compose to launch web server
  • Loading branch information
eyurtsev authored Mar 1, 2024
1 parent a5db819 commit dc9d788
Showing 1 changed file with 34 additions and 16 deletions.
50 changes: 34 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,48 @@ Response:

## ✅ Running locally

The `backend` code is located in `/backend`.
The easiest way to get started is to use `docker-compose` to run the server.

The backend code relies on having access to a postgres instance.
**Configure the environment**

Add `.local.env` file to the root directory with the following content:

### Launch Postgres
```sh
OPENAI_API_KEY=... # Your OpenAI API key
```

Build the images:
```sh
docker compose build
```

Use the `docker-compose.yml` file in the root directory to launch a postgres instance.
Run the services:

```sh
docker compose up postgres
docker compose up
```

### Launch the extraction webserver
This will launch both the extraction server and the postgres instance.

At the moment, we don't have the backend defined in docker compose, so
you'll need to set up the backend.
Verify that the server is running:

```sh
curl -X 'GET' 'http://localhost:8000/ready'
```

This should return `ok`.


## Contributions

Feel free to develop in this project for your own needs!
For now, we are not accepting pull requests, but would love to hear [questions, ideas or issues](https://github.com/langchain-ai/langchain-extract/discussions).

## Development

To set up for development, you will need to install [Poetry](https://python-poetry.org/).

The backend code is located in the `backend` directory.

```sh
cd backend
Expand All @@ -158,13 +183,6 @@ From `/backend`:
OPENAI_API_KEY=[YOUR API KEY] python -m server.main
```

## Set up for development

Use this if you want to develop in your own fork of the repo.

For now, we will not be accepting pull requests, but would love to hear any feedback
about ideas or issues etc.

### Testing

Create a test database. The test database is used for running tests and is
Expand All @@ -187,4 +205,4 @@ Testing and formatting is done using a Makefile inside `[root]/backend`

```sh
make format
```
```

0 comments on commit dc9d788

Please sign in to comment.