Add connection between spring boot server and postgresql database

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
Guillaume Lours
2020-03-12 14:16:55 +01:00
parent 7d4d65c780
commit ddcbf6f7bd
9 changed files with 107 additions and 1 deletions

View File

@@ -4,6 +4,10 @@ services:
build: backend
ports:
- 80:8080
environment:
POSTGRES_DB: example
networks:
- spring-postges
db:
environment:
POSTGRES_DB: example
@@ -14,8 +18,12 @@ services:
- db-password
volumes:
- db-data:/var/lib/postgresql/data
networks:
- spring-postges
volumes:
db-data: {}
secrets:
db-password:
file: db/password.txt
networks:
spring-postges: {}