-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
31e0f53
commit 68bf3a2
Showing
1 changed file
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |