A Java container application with Maven, Docker, MySQL and some samples.
- Install Docker in your host machine. Follow docker documentation and don't forget the optional steps if running on Linux.
- If you are running on Windows, make sure your system met the minimum requirements.
- Run
docker-compose pull
to download container images - Execute
docker-compose run mvn
to build Java classes and download dependencies files. - Launch with
docker-compose up tomcat
and open your browser. - The default address is
http://localhost:8080
but this can be changed indocker-compose.yml
.
This boilerplate uses Maven Standard Directory Layout to organize the app.
web.xml
file is located on src/main/webapp/WEB-INF
.
Default project package is br.ufscar
.
Maven container entrypoint is set to mvn
, making easy to run maven commands (e.g: docker-compose run mvn clean install
). Default command is install
, so running docker-compose run mvn
is the same as mvn install
.
A database dump file could be placed on database\data
folder. When MySQL container is created, all scripts in that folder will be executed.