3 Commits

2 changed files with 38 additions and 21 deletions
@@ -1,9 +1,9 @@
spring:
datasource:
url : ${DB_TEST_URL}
url: ${DB_TEST_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: ${PG_DRIVER_CLASS_NAME}
jpa:
hibernate:
ddl-auto: create-drop
ddl-auto: update
+36 -19
View File
@@ -138,7 +138,7 @@ spring:
```
Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. The Docker Compose file will look something like this:
The Docker Compose file for code-server will look something like this:
```
---
@@ -163,26 +163,43 @@ services:
- 8124:8080
- 5173:5173
restart: unless-stopped
```
vaessl-db:
image: pgvector/pgvector:pg18
container_name: vaessl-db
environment:
- POSTGRES_DB=vaessl
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pw
ports:
- 5433:5432
Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. Just add databases via SQL or PgAdmin and install the pgvector extension to each database manually. There is an offical ready-made pgvector docker image but if you already host a PostGreSQL database you need to add the extension yourself.
vassal-test-db:
image: pgvector/pgvector:pg18
container_name: vassal-test-db
environment:
- POSTGRES_DB=vassal_test
- POSTGRES_USER=user
- POSTGRES_PASSWORD=pw
ports:
- 5434:5432
Check the name of your PostGreSQL container:
```
docker ps
```
Enter your container via bash:
```
docker exec -it 876fb382969f bash
```
Before working on your database backup your databases:
```
su - postgres -c "pg_dumpall > /tmp/backup200526.sql"
#exit the container and copy the backup file to local file system
docker cp 876fb382969f:/tmp/backup200526.sql .
```
Install dependencies, build and install pgvector:
apt-get update
apt-get install -y build-essential git postgresql-server-dev-all
```
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make
make install
docker restart 876fb382969f
```
Enter PostGreSQL container and create pgvector extension for each databse:
```
docker exec -it <container-name> psql -h localhost -U <db-user> -d <db-name>
CREATE EXTENSION vector;
```
# Appendix: Additional config for developing in Code-Server