Giter VIP home page Giter VIP logo

java_app's Introduction

Simple Java Springboot application

Simple java springboot application endpoint :8080/health should answer "UP". To build jar please use:

docker run -it --rm --name my-maven-project -v C:\DiskD\Study\Epam\Docker\projects\java_app:/usr/src/app -v %UserProfile%/.m2:/root/.m2 -w /usr/src/app maven:3.6-jdk-8 mvn clean package
docker run -it --rm --name my-maven-project -v "$PWD":/usr/src/app -v "$HOME"/.m2:/root/.m2 -w /usr/src/app maven:3.6-jdk-8 mvn clean package

Application can take environment variables:

DB_MYSQL_HOST: "mysqlhost"
DB_MYSQL_PORT: 3306
DB_MYSQL_NAME: "testdb"
DB_MYSQL_USER: root
DB_MYSQL_PASS: "123456aA"

Use this app to conver .sh file to Unix format https://waterlan.home.xs4all.nl/dos2unix.html

HOMEWORK

  1. Build jar file from sources https://github.com/danuf/java_app using maven container maven:3-jdk-8
  2. Write docker-compose.yaml which contains mysql database container and application container:
  • Use mysql/mysql-server:5.7 image
  • Specify mysql_database, mysql_root_password, and mysql_root_host env variables for mysql cotainer
  • Application container should use “build:” instruction in compose file
  • Link containers to each other
  • Specify memory limits for each container
  • Pass parametes through env variables for application container like this:
    • DB_MYSQL_HOST: "mysqldb"
    • DB_MYSQL_PORT: 3306
    • DB_MYSQL_NAME: "testdb"
    • DB_MYSQL_USER: root
    • DB_MYSQL_PASS: "123456aA"
  • Expose application container to 80 port of localhost
  1. Run docker-compose and sure that app container is connected to db. Check logs
  2. Provide configuration file (docker-compose.yaml) and screenshot of web interface as prove result of homework

java_app's People

Contributors

tamamshud avatar danuf-zz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.