Комментарии:
Could you share a link to the github repository of this project?
ОтветитьThank you
ОтветитьHi thank you for giving the information. i am facing issue with dataSource
-----------
app propertes file : -
spring.datasource.url=jdbc:postgresql://localhost:5432/student-db
spring.datasource.username=postgres
spring.datasource.password=admin
spring.jpa.show-sql=true
## Hibernate Properties
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa.hibernate.ddl-auto=create
spring.application.name=student-service
server.port=8086
-------------------------
dockerfile
FROM openjdk:17
WORKDIR /app
COPY target/student-service-1.0.0.jar .
EXPOSE 8085
ENTRYPOINT ["java","-jar","student-service-1.0.0.jar"]
-------------------------------------------
docker compose :
version: "2"
services:
db:
ports:
- 5433:5432
container_name: postgresql_container
image: postgres:14.1-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=student-db
volumes:
- D:\postgres_datapart:/var/lib/postgresql@14/data:rw
restart: always
backend:
build: .
container_name: studentservice_container
ports:
- 8085:8085
environment:
db-url: jdbc:postgresql://db:5432/student-db
db-username: postgres
db-password: admin
depends_on:
- db
restart: always
--------------------------
suggest here to overcome the data source issue
When i add the dynamic variables ${db-url} etc and try to build my springboot application there is a error for connectivity with postgresql server. I think its because there is not container for postgres yet and therefore no DB , when should I build the springboot application with those changes or without them ??
ОтветитьThank you very much for help. It would be much cooler if you do git repo for every video.
ОтветитьI'm getting communication link failure I have given all properties and creditentails correctly. But I don't know and I have tried many way them too I'm facing this issue, can proved me with any solutions?
Ответить