1- Application will be run and executed using the bellow command.
2- Site accessible from url http://localhost:8080
Make suer your docker is up and runing on your local machine
###Run the System We can easily run the whole with only a single command:
docker-compose up
Docker will pull the MySQL and Spring Boot images (if our machine does not have it before). The services can be run on the background with command:
docker-compose up -d
Stopping all the running containers is also simple with a single command:
docker-compose down
This application testn Windows you will may face issue related to .env file on iOS So replace docker-compose.yml content file with following code:
version: "3.8"
services:
mysqldb:
image: mysql:5.7
container_name: mysql-image
restart: unless-stopped
env_file: ./.env
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=student_service
ports:
- 3306:3306
volumes:
- ./data/logs:/logs
- ./usr/local/var/mysql:/var/lib/mysql
api:
depends_on:
- mysqldb
links:
- mysqldb:mysqldb
container_name: api
restart: on-failure
image: studnent-service-img
build:
context: ./crud-service
dockerfile: ./Dockerfile
ports:
- 8080:8080