Put default data into MS database

Since the container is ephemeral, you should consider mapping an external volume which has the already created database on it. You could potentially create it by bringing up the container once and then running the mysql client in it to source the database from a dump file.
Here’s an example slightly redacted from a compose file I use:
mysql:
image: mysql:5.7.29
networks:
- backend
environment:
- MYSQL_ROOT_PASSWORD=mysql

  • MYSQL_DATABASE=mydatabase
    volumes:
    - /docker_var/mysql:/var/lib/mysql
    - /docker_var:/var/files
    ports:
    - 33061:3306