diff --git a/backend/.gitignore b/backend/.gitignore index fcbf23e..893eb43 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,3 +1,4 @@ screenmark .env.docker .env +pgdata diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml index b0c6e36..ff927fd 100644 --- a/backend/docker-compose.yml +++ b/backend/docker-compose.yml @@ -5,12 +5,14 @@ services: environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: password + POSTGRES_DB: haystack volumes: - ./schema.sql:/docker-entrypoint-initdb.d/schema.sql + - ./pgdata:/var/lib/postgresql/data ports: - 4321:5432 healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d haystack_db"] + test: ["CMD-SHELL", "pg_isready -U postgres -d haystack"] interval: 10s retries: 5 start_period: 5s diff --git a/backend/schema.sql b/backend/schema.sql index 822f68b..a2d254e 100644 --- a/backend/schema.sql +++ b/backend/schema.sql @@ -1,6 +1,3 @@ -DROP DATABASE IF EXISTS haystack_db; -CREATE DATABASE haystack_db; - DROP SCHEMA IF EXISTS haystack CASCADE; CREATE SCHEMA haystack;