- Fork this project
- Add your DDL script here
- Add your DML script here
- Continue setting up your
@Entityclasses and@Repositoryinterfaces - You may access the database using the h2-console by visiting the
/h2-consolepath here.
| Key | Value |
|---|---|
| Driver Class | org.h2.Driver |
| JDBC URL | jdbc:h2:mem:m3db |
| User Name | sa |
| Password | password |
Before running the docker commands, make sure you have a .dockerignore file with content target to ignore the artifact folder.
You can still run the Spring Boot Application with docker without any JDK/JRE installed. You should understand what Option A is doing before going for Option B.
cd ./spring-boot-h2-setup/m3project
# Option A - manual docker command to build and run the project
docker build -t "h2_starter" .
docker run -d -p 8088:8080 --name "container_h2_starter" h2_starter
# Stop container for rebuild
docker stop container_h2_starter
docker rm container_h2_starter
# Option B (better choice) - use of docker compose
docker compose up
# Rebuild container
docker compose up --build # add a --build flag to rebuildVisit http://localhost:8088/test on browser for "Test ok" response to confirm the application is running.
End
