Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jayachandhar committed Jul 26, 2024
1 parent 31e0f53 commit 68bf3a2
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
# docker-postgres-ai

This repository is used to build Docker images for Postgres DB with
the [PGVector](https://github.com/pgvector/pgvector), [VectorScale](https://github.com/timescale/pgvectorscale), [PGAI](https://github.com/timescale/pgai)
extensions.
This Docker images extends official [Postgres docker image](https://hub.docker.com/_/postgres) with
the following extensions:

* [PGVector](https://github.com/pgvector/pgvector)
* [VectorScale](https://github.com/timescale/pgvectorscale)
* [PGAI](https://github.com/timescale/pgai)

Current state:

* postgres 16.3 image with pgvector, pgai and vectorscale extension.
* Postgres 16.3 image with pgvector, pgai and vectorscale extension.

Cmd for local docker build
## Getting started

```shell
docker build -t postgres:16.3 .
#### Cmd to run this docker image

```shell
$ docker run -p 5432:5432 -e POSTGRES_PASSWORD=secretpassword jayachandhar/postgres:16.3
```

Cmd to use pre-built docker image
More environment variables can be set following
the [official postgres documentation.](https://github.com/docker-library/docs/blob/master/postgres/README.md#environment-variables)

#### Enable the PG extensions;

* Open a new terminal, and connect to postgres DB

```shell
$ docker run -p 5432:5432 -e POSTGRES_PASSWORD=secretpassword jayachandhar/postgres:16.3
PGPASSWORD=secretpassword psql -h localhost -U postgres postgres
```

* Create the extension:

```shell
CREATE EXTENSION IF NOT EXISTS vector;
CREATE EXTENSION IF NOT EXISTS vectorscale;
CREATE EXTENSION IF NOT EXISTS plpython3u;
CREATE EXTENSION IF NOT EXISTS ai;
```

Environment variables can be set following the official postgres documentation:
https://github.com/docker-library/docs/blob/master/postgres/README.md#environment-variables
## TODO

[ ] add usage example & sample queries.

0 comments on commit 68bf3a2

Please sign in to comment.