Commit 79415cb4 authored by Wade's avatar Wade

add pg

parent dbc1cefb
-- Create the qa table if it doesn't exist
CREATE TABLE IF NOT EXISTS public.qa (
id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
question TEXT,
answer TEXT,
summary TEXT,
"from" TEXT,
"to" TEXT,
from_id TEXT,
to_id TEXT,
milvus BOOLEAN DEFAULT FALSE,
graph BOOLEAN DEFAULT FALSE,
CONSTRAINT qa_pkey PRIMARY KEY (id)
) TABLESPACE pg_default;
-- Create or replace the qa_latest_from_id view
CREATE OR REPLACE VIEW public.qa_latest_from_id AS
SELECT DISTINCT ON (qa.from_id)
qa.id,
qa.created_at,
qa.question,
qa.answer,
qa.summary,
qa."from",
qa."to",
qa.from_id,
qa.to_id,
qa.milvus,
qa.graph
FROM
qa
WHERE
qa.from_id IS NOT NULL
ORDER BY
qa.from_id,
qa.created_at DESC;
\ No newline at end of file
version: '3.8' # Specify version for clarity
services:
db:
image: postgres
restart: always
shm_size: 128mb
environment:
POSTGRES_PASSWORD: example
volumes:
- ./config/pg/init.sql:/docker-entrypoint-initdb.d/init.sql # Mount the init script
ports:
- 5432:5432 # Expose PostgreSQL port to host
adminer:
image: adminer
restart: always
ports:
- 8080:8080
......@@ -11,7 +11,7 @@ services:
- GEMINI_API_KEY=${GEMINI_API_KEY} # Reference variable from .env
ports:
- "8000:8000"
entrypoint: /bin/sh -c "sleep 60 && /app/myapp -milvus-addr=standalone:19530 -graphrag-addr=webserver:5670"
entrypoint: /bin/sh -c "sleep 60 && /app/myapp -milvus-addr=standalone:19530 -graphrag-addr=webserver:5670 -pg-conn-string=postgresql://postgres:example@db:5432/postgres"
depends_on:
- standalone
- webserver
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment