The docker-compose.yml file provides a MySQL service configuration. You can use this to run a MySQL instance compatible with the application.
Key environment variables:
MYSQL_ROOT_PASSWORD: Set the root password.MYSQL_ALLOW_EMPTY_PASSWORD: Set to true to allow empty passwords.MYSQL_USER: The database user (defaults to petclinic).MYSQL_PASSWORD: The password for the database user (defaults to petclinic).MYSQL_DATABASE: The name of the database to create (defaults to petclinic).
Configuration files can be mounted to ./conf.d to customize the MySQL server settings.
services:
mysql:
image: mysql:9.7
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_USER=petclinic
- MYSQL_PASSWORD=petclinic
- MYSQL_DATABASE=petclinic
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"