Skip to content

Commit

Permalink
Update docker compose env + README (#72)
Browse files Browse the repository at this point in the history
* fix: docker-compose env vars

* chore: update README

* chore: `fullstack` profile
  • Loading branch information
stefanorosanelli authored Oct 15, 2024
1 parent 56f9ed2 commit 63699e0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,30 @@ It is a webapp with which you can:
## Requirements

A version of Python 3.10 or higher and [Poetry](https://python-poetry.org/docs/#installation) is required.
A PostgreSQL database version 11 or higher with [`pg_vector`](https://github.com/pgvector/pgvector), but you can use the provided docker image for a quicker setup.
A PostgreSQL database version 14 or higher with [`pg_vector`](https://github.com/pgvector/pgvector), but you can use the provided docker image for a quicker setup.

## Quick start
## Quick try

The quickest way to try out Brevia is using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) template project like this:
The easiest and fastest way to try Brevia is through Docker. By launching docker compose with the following command you will have a working Brevia system without any setup or configuration:

```bash
docker compose --profile fullstack up
```

At this point you will have:

* Brevia API on http://localhost:8000
* Brevia App UI on http://localhost:3000

To use ports other than 8000 or 3000 just uncomment the variables `BREVIA_API_PORT` or `BREVIA_APP_PORT` in the .env file.

You can also use `--profile api` option to just start Brevia API and not Brevia App.

## Create a Brevia Project

### Quick start

The quickest way to create a new Brevia project is using the [cookiecutter](https://github.com/cookiecutter/cookiecutter) template project like this:

```bash
pip install cookiecutter
Expand All @@ -51,9 +70,9 @@ cookiecutter gh:brevia-ai/brevia-cookiecutter

Simply answer few simple questions and you're ready to go.

## Manual setup
### Manual setup

To perform a manual setup instead follow these steps:
To manually create a project instead follow these steps:

* create a new project with `poetry new {your-brevia-project}`
* install brevia and its dependencies by running `poetry add brevia`, a virtualenv will automatically be created
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- 5433:${PGVECTOR_PORT:-5432}
- ${PGVECTOR_PORT:-5432}:5432
pgadmin:
image: dpage/pgadmin4
profiles: ["admin"]
Expand All @@ -21,11 +21,11 @@ services:
volumes:
- pgadmindata:/var/lib/pgadmin
breviaapi:
image: ghcr.io/brevia-ai/brevia:latest
profiles: ["api"]
image: ghcr.io/brevia-ai/brevia
profiles: ["api", "fullstack"]
environment:
- PGVECTOR_HOST=pgdatabase
- PGVECTOR_PORT=${PGVECTOR_PORT:-5432}
- PGVECTOR_PORT=5432
- PGVECTOR_DATABASE=${PGVECTOR_DATABASE:-brevia}
- PGVECTOR_USER=${PGVECTOR_USER:-postgres}
- PGVECTOR_PASSWORD=${PGVECTOR_PASSWORD:-postgres}
Expand All @@ -35,10 +35,10 @@ services:
volumes:
- breviaapidata:/var/lib/breviaapi
breviaapp:
image: ghcr.io/brevia-ai/brevia-app:latest
profiles: ["admin", "api"]
image: ghcr.io/brevia-ai/brevia-app
profiles: ["fullstack"]
environment:
- NUXT_API_BASE_URL=http://breviaapi:${BREVIA_API_PORT:-8000}
- NUXT_API_BASE_URL=http://breviaapi:8000
ports:
- "${BREVIA_APP_PORT:-3000}:3000"
volumes:
Expand Down

0 comments on commit 63699e0

Please sign in to comment.