Added postgress database
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
# Use the official PostgreSQL image as base
|
||||||
|
FROM postgres:18.4
|
||||||
|
|
||||||
|
# Install build dependencies and pgvector
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
git \
|
||||||
|
postgresql-server-dev-18 \
|
||||||
|
python3 \
|
||||||
|
python3-pip \
|
||||||
|
python3-psycopg2 \
|
||||||
|
&& git clone --branch v0.8.2 https://github.com/pgvector/pgvector.git \
|
||||||
|
&& cd pgvector \
|
||||||
|
&& make \
|
||||||
|
&& make install \
|
||||||
|
&& cd .. \
|
||||||
|
&& rm -rf pgvector \
|
||||||
|
&& apt-get remove -y build-essential git postgresql-server-dev-18 \
|
||||||
|
&& apt-get autoremove -y \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
docker build -t custom-postgres .
|
||||||
|
docker tag custom-postgres 10.0.2.119:5000/custom-postgres
|
||||||
|
docker push 10.0.2.119:5000/custom-postgres
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# Docker
|
||||||
|
|
||||||
|
Custom Docker images built on top of official base images.
|
||||||
|
|
||||||
|
## Postgres
|
||||||
|
|
||||||
|
A custom PostgreSQL 18.4 image with the [pgvector](https://github.com/pgvector/pgvector) extension (v0.8.2) for vector similarity search.
|
||||||
|
|
||||||
|
### Build
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd Postgress
|
||||||
|
./build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
`build.sh` builds the image, tags it as `custom-postgres`, and pushes it to a private registry at `10.0.2.119:5000`.
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker run -d \
|
||||||
|
--name postgres \
|
||||||
|
-e POSTGRES_PASSWORD=secret \
|
||||||
|
-p 5432:5432 \
|
||||||
|
custom-postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable the extension in a database:
|
||||||
|
|
||||||
|
```sql
|
||||||
|
CREATE EXTENSION vector;
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user