Skip to content

Commit

Permalink
Add Docker Compose for Postgres setup and update configs
Browse files Browse the repository at this point in the history
Added a Docker Compose file for setting up a Postgres container easily. Updated `local_db.md` with a corrected `docker run` command and adjusted database configuration in `application-local.yaml` to match the new setup.
  • Loading branch information
krharum committed Sep 12, 2024
1 parent 770c683 commit 22467c1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 2 additions & 5 deletions apps/dolly-backend/src/main/resources/application-local.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ spring:
generic:
enabled: false
datasource:
url: jdbc:postgresql://localhost:5432/dolly-test
username: postgres
hikari:
maximum-pool-size: 3
minimum-idle: 1
url: jdbc:postgresql://localhost:5432/postgres

This comment has been minimized.

Copy link
@rfc3092

rfc3092 Sep 12, 2024

Contributor

Til info, dette er ikke kompatibelt med importen som er beskrevet i local_db.md. Jeg tror heller ikke du ønsker at alle apper skal samles i databasen/skjemaet postgres ved kjøring lokalt.

driver-class-name: org.postgresql.Driver
username: postgres

management:
endpoints:
Expand Down
10 changes: 10 additions & 0 deletions docs/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
postgres:
container_name: postgres
image: postgres:latest
environment:
- POSTGRES_DB=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- "5432:5432"
restart: always
2 changes: 1 addition & 1 deletion docs/local_db.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Legg merke til at vi bruker `--exclude-table` i dette eksempelet. I denne databa
**Dette gjøres bare én gang.** Vi lager oss en container kalt `postgres`, der auth er slått av fra din Docker host. Default-brukeren `postgres` vil stå som eier av alle tabeller.

~~~
> docker run --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres
> docker run --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 postgres -c
~~~

Her kjøres containeren uten `--detach`, slik at vi kan følge med på logger i tilfelle feil under import, men det er valgfritt.
Expand Down

0 comments on commit 22467c1

Please sign in to comment.