you can follow examples or use a script like wpdockerize
to create the docker-compose.yml
file with basic configuration.
Have a look here: https://github.com/diego-betto/wpdockerize
Then all you need to do is run
wpdockerize
and follow the few questions about your configuration and you are ready to go with
docker-compose up -d