feat: adds apache age + pgvector compatible dev container
This commit is contained in:
parent
5cf63617a1
commit
c67a4a591b
3 changed files with 51 additions and 4 deletions
|
|
@ -123,20 +123,24 @@ services:
|
|||
- "3002:8000"
|
||||
|
||||
postgres:
|
||||
image: pgvector/pgvector:pg17
|
||||
build: ./postgres-age-vector
|
||||
container_name: postgres
|
||||
restart: always
|
||||
profiles:
|
||||
- postgres
|
||||
environment:
|
||||
POSTGRES_USER: cognee
|
||||
POSTGRES_PASSWORD: cognee
|
||||
POSTGRES_DB: cognee_db
|
||||
# - postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- 5432:5432
|
||||
networks:
|
||||
- cognee-network
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./postgres-age-vector/init:/docker-entrypoint-initdb.d
|
||||
command:
|
||||
- "postgres"
|
||||
- "-c"
|
||||
- "shared_preload_libraries=age"
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
|
|
|
|||
35
postgres-age-vector/Dockerfile
Normal file
35
postgres-age-vector/Dockerfile
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
FROM pgvector/pgvector:pg16
|
||||
|
||||
USER root
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
build-essential \
|
||||
git \
|
||||
postgresql-server-dev-16 \
|
||||
libreadline-dev \
|
||||
zlib1g-dev \
|
||||
flex \
|
||||
bison \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cd /tmp && \
|
||||
git clone --branch master https://github.com/apache/age.git && \
|
||||
cd age && \
|
||||
make PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config && \
|
||||
make PG_CONFIG=/usr/lib/postgresql/16/bin/pg_config install && \
|
||||
cd .. && \
|
||||
rm -rf age
|
||||
|
||||
RUN apt-get purge -y --auto-remove \
|
||||
build-essential \
|
||||
git \
|
||||
postgresql-server-dev-16 && \
|
||||
apt-get clean
|
||||
|
||||
RUN mkdir -p /docker-entrypoint-initdb.d
|
||||
|
||||
USER postgres
|
||||
|
||||
CMD ["postgres"]
|
||||
|
||||
8
postgres-age-vector/init/01_init_extensions.sql
Normal file
8
postgres-age-vector/init/01_init_extensions.sql
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
CREATE EXTENSION IF NOT EXISTS vector;
|
||||
|
||||
LOAD 'age';
|
||||
|
||||
CREATE EXTENSION IF NOT EXISTS age;
|
||||
|
||||
GRANT USAGE ON SCHEMA ag_catalog TO cognee;
|
||||
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA ag_catalog TO cognee;
|
||||
Loading…
Add table
Reference in a new issue