springboot web application backend
56
#Please make sure to create network in Docker
step1 : docker network create network_name
#Run the mysql-container with the network and the MYSQL_ROOT_PASSWORD=root
step2 : docker run --name=mysql-container
--network=network_name
-e MYSQL_ROOT_PASSWORD=root
-p 3306:3306
-d mysql
#After run the mysql-container, exec the container and create a database name ict and create table tickets
step3 : docker exec -it mysql-container mysql -u root -p (password : root)
step4 : create database ict;
step5 : use ict;
step6 : CREATE TABLE tickets ( sid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ticketerid VARCHAR(10), ticketername VARCHAR(50), ticketdate VARCHAR(10), ticketdesc VARCHAR(50), tickettime VARCHAR(10));
step7 : exit
#After successfully create table, run the spboot-container for backend support of webapplication with the same network
step8 : sudo docker run --name=spboot-container
--network= network_name
-e SPRING_DATASOURCE_URL="jdbc:mysql://mysql-container:3306/ict"
-e SPRING_DATASOURCE_USERNAME="root"
-e SPRING_DATASOURCE_PASSWORD="root"
-p 9090:8080
-d selvamuthukumar0503/spboot
#ouput shows the spring-boot application logs
Content type
Image
Digest
sha256:2a803f53c…
Size
285.2 MB
Last updated
about 2 years ago
docker pull selvamuthukumar0503/spboot:v0