How To Create Multi Containers Using Docker Compose | For SpringBoot & Postgresql
HTML-код
- Опубликовано: 4 дек 2024
- Tap here and stay connected for upcoming videos: / @codevice111
Part 2 : How to create multi containers by using docker-compose tool for Spring boot application and PostgreSql database.
Part 1: How to dockerize spring boot app and postgreSQL db using docker run command
• How To Dockerize Sprin...
Development Tools & Frameworks:
1. #springboot
2. #postgresql / #postgres
3. #swagger
4. #hibernate
5. #pgadmin
6. #docker
7. #dockercompose
Do subscribe at:
/ @codevice111
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?
You might see console log errors. But still try accessing swagger endpoint. If it's opening then your container is up. and make sure the connection properties are accurate as per the video. And make sure you've restart:always configured for both the containers for retry-fallback mechanism.
Thank you very much for help. It would be much cooler if you do git repo for every video.
Oh I see. Sure. I'll keep that in mind. Thanks 😊
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 ??
U may encounter this connection err. Thats why we are adding a retry fallback option called "restart: always" in docker compose. Now 2nd thing is.. even though there is an err.. still.. try accessing swagger or thru postman etc.. and do insert 1 record.
very nice video, but I have a question, you placed a pgadmin in the docker-compose, what do you use now the pgadmin installed in the machine? I would like to use the pgadmin placed in the docker compose, but it does not work.
I have separately installed pgAdmin. Its not running as a container.
I have installed pgAdmin separately.
Thank you
Thanks! But it would be great if you solved the connection issue!
Point taken. 😊
and also why did you make the application dockerfile?
can i have you github ?
Sorry for that, I've not kept it in GitHub.
But, point taken. Thanks for watching.
Cant access my web application from the browser
please check whether desired number of containers are up and running or not, by simply running `docker ps `. or `docker ps --all`.
If your desired containers are listed. Then you can
trace the exact log of individual container with this command called: `docker logs `. Thanks for watching.
Could you share a link to the github repository of this project?
Unfortunately, I've not kept it in git.
Hi , I'm trying to deploy my springapplication + postgres , I have created a docker file , created my docker compose file, I have successfully ran "docker-compose build", but on running , i got this below error: "Cannot invoke "org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(java.sql.SQLException, String)" because the return value of "org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.sqlExceptionHelper()" is null " kindly help me to resolve this issue
Sure buddy.
Could you please help me what are you getting when u check the followings:
1. After executing "docker-compose up" are you able to see 2 running containers when you do "docker ps"? (Y/N)
2. Able to connect to db from pgAdmin? Before testing the db connection Spring boot app. (Y/N)
3. Both containers must on the same docker network. (Y/N)
4. If the above things are good. Doble check the db connection in your app.yaml file.
Do leme know what you see buddy