JHipster creates a Dockerfile for the application and provides docker-compose files for all the technologies we choose, such as the database, search engine, Jenkins, and so on, under src/main/docker:
├── app.yml - Main compose file for the application
├── Dockerfile - The Dockerfile for the application
├── hazelcast-management-center.yml - Compose file hazelcast management center
├── jenkins.yml - Compose file for Jenkins
├── mysql.yml - Compose file for the database that we choose.
└── sonar.yml - COmpose file for SonarQube.
Let's see how we can start our production database using Docker from the compose file provided under src/main/docker/mysql.yml. You will need to use a Terminal for the following instructions:
- Run docker --version and docker-compose --version to ensure these are installed.
- Run docker ps to list the running containers. If you are not already running any containers, you should see an empty list.
- Let's start the DB by running docker-compose -f src/main/docker/mysql.yml up.
You will see the following console output:

If you want to run the service in the background, pass the -d flag to the command. docker-compose -f src/main/docker/mysql.yml up -d will let you continue to use the same Terminal without having to switch to another.
Now if you run docker ps again, it should list the database service that we started:
