Я докертизировал свое приложение springboot и теперь, используя docker-compose, я бы хотел подключиться к образу postgres.
Мой docker-compose.yml:
version: "3"
services:
backend:
image: hreview-backend
deploy:
replicas: 2
ports:
- "8080:8080"
volumes:
- /var/lib/springboot/data
db:
image: postgres
restart: always
volumes:
- /var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: root
POSTGRES_DB: hreview
ports:
- "5432:5432"
frontend:
image: hreview-frontend
deploy:
replicas: 1
ports:
- "4200:4200"
Тогда в моем application.properties у меня есть:
spring.datasource.url=jdbc:postgresql://db:5432/hreview
spring.datasource.username=root
spring.datasource.password=password
Поскольку я использую ddl-auto:update
hibernate должен создатьстолы.
Я получаю ошибку:
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [create table user (id int4 not null, age int4, email varchar(255), name varchar(255), password varchar(255), role varchar(255), primary key (id))] .....
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "user