I am a newbie to SpringBoot. I am trying to create a spring boot application which i am running using docker. when i run this app, i get the following error
org.postgresql.util.PSQLException: FATAL: role "amigoscode" does not exist
I don't have any hint, as i am not able to trace this error. Role "amigoscode" already exists. I am attaching below the application.yml and docker-compose.yml
application.yml
server:
port: 8080
spring:
application:
name: customer
datasource:
password: password
url: jdbc:postgresql://localhost:5432/customer
username: amigoscode
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: 'true'
show-sql: 'true'
docker-compose.yml
services:
postgres:
container_name: postgres
image: postgres
environment:
POSTGRES_USER: amigoscode
POSTGRES_PASSWORD: password
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
networks:
- postgres
restart: unless-stopped
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
PGADMIN_CONFIG_SERVER_MODE: 'False'
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "5050:80"
networks:
- postgres
restart: unless-stopped
networks:
postgres:
driver: bridge
volumes:
postgres:
pgadmin:
Can you please guide me, what i might be doing wrong here? I have referred other similar question here, but none of them solves my issue. Thank you.