docker compose example | spring boot & mysql docker-compose
Vložit
- čas přidán 25. 12. 2021
- How to deploy spring boot and mysql in docker container using docker-compose .
git link: gitlab.com/codingboot-youtube...
Deploy spring boot & mysql using docker
• Docker spring boot MyS... - Věda a technologie
Been having trouble with this for a while now, and your video was what helped to finally get my project up and running. Thanks!
Thank you very much for this video and the previous one. It is much more valuable than most paid courses on platforms. You went straight to the point with an excellent practical example. I've followed step-by-step everything you've done, and everything works perfectly.
Thank you 😊
is there someone snoring in the background on min 9:41 ?????
Sorry about that!
I followed the process slightly in a different way.
I used buildpacks to build the dockerfile(no dockerfile actually, buildpacks were making the image in the background),
and postgres.
I managed to do everything the tutorial was trying to teach. One thing I stumbled was that when I was doing docker compose down,
I sometimes had to remove the stopped containers else the database was acting weird and I had errros.
Other that that, it was an amazing tutorial mate! thank you very much! Liked and subscribed!!
Thank you:)
Really detailed and concise, thank you sir!
Just solved the problem been bothering me for days by seeing your video.
I'm glad the video was helpful 😇
Sir, It's awesome, I have basic ideas of docker and I was trying to learn advance docker my own but not able to start and getting irritation and last left but when I randomly watched your video, I say it's simply awesome. Thank you so much and going to subscribe to your channel to get more and more.
Thank you 😊
I dont even use java, I wanted to use it for a golang app and this video did explain everything very clearly, thanks sir :)
absolute legend, mate. helped a lot, thanks.
Thanks a lot! Glad I could assist!
Great job. Thanks
So good. Thank you for video.
Glad you liked it! Thank you!
Thank you guy, good job!
Thank you! Glad you enjoyed it!
Don't we have to use links command with spring boot service to link it with MySQL service so that it is able to connect to MySQL container name and its corresponding container specific host 3306?
Enjoying your video's as you give more detail which is very usefull. Thanks!
Thank you
Great explanation, Keep it up
Thank you:)
Thank you
you are the king
Thank you 😊
Thank you very much
You're welcome! 😊
when I tried using Postman with the POST method to insert data it is not inserted in the database. But it is stored in the volume that I have created
Thank you very much sir . I really appreciate the video due to excellent hand son practical. really help me a lot ....and finnaly my project is up and running
I'm glad the video was helpful for your project. If you have any more questions, just let me know. Good luck!
amazing tutorial
Thank you
I Kiss your eyes ! Thanks man !!!!!
❤
Wtf eyes?
you can use "depends_on" attribute for starting services in order
Thanks
i want to ask question sir in application properties y u not mentioned username and password as root because in yml file u mention as root
is it compulsary to have different???? in both?
thank you man)
No problem, glad I could help!
lol - lots of ❤❤❤❤
hi,
i am unable to create connection using 3307 showing error. please help
Which IDE you are using for creating docker compose file?
STS
Hey i need some help.When I am rebuild the jar after adding the properties of mysql in the application.properties file the build is not getting successful. During mvn package the app is not able to connect to mysql
Do you want connect MySQL container or host machine MySQL?
Please make sure to specify env variable while connecting to container
Thanks a lot for this video. its very useful. Can you also cover communication between Micro-services?
czcams.com/video/evZwss6HYto/video.html
@@codingboot455 Thanks brother.
Awesome... One question...In order to connect from Spring app to MySQL, don't we need to setup network in docker-compose?
Docker compose automatically create a network and attached to all services. You can also create custom network and configure in yml file
@@codingboot455 Wow... I didn't know that. Thank you for the clarification.
i ve one doubt. U r connecting Dbeaver with mysql host localhost user and pwd as root and db as test and port as 3307. When u r telling host as localhost whether its an local db or container db? Suppose u r running spring boot app instance in docker container and not in localhost, db will be persisted to container db and not in local db. Then why r u restarting and checking in local db with localhost and not in container db. And another doubt if u add more data in container db and not in local db. Suppose if u remover container db and again create cont db, whether through volume, it will sync up in both sides and if i make any changes in localdb whether it will sync with container db and vice versa. I dont know whether am making things complicated or not
How to test it with postman ?, why you create db folder in destop ?
Same url you can hit in postman . Db folder you can create anywhere with any name .
Sir pls answer one more question ,what is difference between java application and spring boot application?
while running docker-compose i am getting this error everytime and i am not able to go forward even jar file is there in target it is showing this error ( "ERROR [springboot-app internal] load build context 0.0s")
but i am able to do this using just dockerfile for normal text message but i am not able to do docker-compose
Can you please post your complete log trace ?
Great video! How does it work without network configs?
docker-compose create network and attach to the container. We don't need to do manually. You can also see in console
You're God
Thanks!
i am still getting errors even after doing the restart: always step in docker-compose.yml. any solution??
What error are you getting?
Excelent video, but i need to dockerize a microservice and make the deployment with Eureka. Do you have a tutorial doing this ?. Awaiting your reply and one more time, congratulations. :)
Thanks 😊, same process for microservice as it's a spring boot application.
czcams.com/video/evZwss6HYto/video.html
Microservice with Eureka ,confiserver ... zookeeper and more....
Will upload a video soon
Just one more question. I tried a lot to deploy 6 microservices using docker and 5 of them are deployed successfully but the microservice that you developed in the video can not be caught by eureka. Why ?. how can i make it ?. The only one error i got is the following: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:ActiveProcessorCount=4 -XX:MaxDirectMemorySize=10M -Xmx4510936K -XX:MaxMetaspaceSize=153415K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:828) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:448) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:241) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198) ~[mysql-connector-java-8.0.30.jar:8.0.30]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) [HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) [HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) [HikariCP-4.0.3.jar:na]
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-4.0.3.jar:na]
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) [hibernate-core-5.6.10.Final.jar:5.6.10.Final]...
but Eureka is not registering the microservice you developed in the video with the database. Please help.
Sir, multiple microservices main, main sarvice ka kaise pata kar sakte hai, ki pehle kon si chalge fir kon
Wo to url se pata chalega , aur code flow
@@codingboot455 Sir, main devops se hu to mujhe bas code deploy karna hota hai Docker par. main confused ho jata hu ki itni sari file main se kon si main file hai , or kon si file chalne ke baad hi dusri kon si file chalani hai, or kya hum ye sab kuch local par hi check kar sakte hai kya, or ye spring boot or java dono alag-alag hai kya.
SIr, please let me know how can i understand all this things.
Thanks.❤😊
Microservice me gateway service entrypoint hota hai . Based on uri request is redirected to service.
Based on configuration file properties/yml everything is taken care . For deployment you can deploy services individually
Hi sir can I email you I'm having a problem in my Docker compose file
What is the issue ? could please share
@@codingboot455 here is my question on stackoverflow Please get back to me when you can and thank you so much stackoverflow.com/questions/74233854/docker-compose-on-jenkins-pipeline-not-working?noredirect=1#
piche koi kharata mar rha h
Hope this video content was helpful for you too ☺️
Hii plzz we need kubernatec now
Your content is really good but u r not uploading videos on regular basis.last video was 1 year ago.
Please upload more SpringBoot projects/ content/information and grow your channel also help us to enhance our skills.
I found your channel, while searching for Jasper report content.
Thanks.
Thank you Sahu. Yesh that's true I'm able to upload on regular basis. I will be uploading soon..
someone snoring in the bckground
I’m sorry for that
Hyu plzz kubernetec
КТО ТАМ ХРАПИТ БМЯДЬ
Извините, буду внимательнее. Спасибо!