Expense tracker application built using spring-boot, Spring JPA, Spring AOP with containerization using Docker.
DEMO
-
Deployed to Heroku Cloud:
Note:
- It is only running on a free dyno, so it may take some time before it responds.
- Data will be reset to default after every 15 mins by the scheduler.
Steps for executing using docker:
-
Clone/Download the repository.
-
Set all the required environmental variables which be impacted on docker-compose.yml. Eg. DB_HOST= [Note: You can get container-name using "docker ps" command] DB_PASS=password DB_SCHEMA=expenese_tracker ACTIVE_PROFILE=dev [This will be always "dev" if it is ran locally. For "prod", it will use heroku.yml and application-prod.properties] PORT=7071 [we need to set PORT because the same dockerfile will be used in production build]
-
Build and run the app using docker-compose. This will build the jar file and run the application.
docker-compose up --build
Steps to deploy on heroku using docker-compose:
-
create heroku.yml as docker-compose.yml is not invoked on heroku.
-
If the application contains database then install mysql or any other database from heroku marketplace[https://elements.heroku.com].
Note: Before installing you need to add credit/debit card info. Without this it wont allow you to install the database.
-
Set the config vars based on the database url.
-
Set the stack:container for the application in order to build with docker-compose.
heroku stack:set container -a <application-name>
-
Deploy the application from heroku.
References