I’m not sure that’s the best solution, but it is a one line solution that works. It’s a bit weird because docker-compose doesn’t properly handle the input redirection so I had to do it through docker.
sudo docker exec -i $(sudo docker-compose ps -q mysql) mysql -uusername -ppassword -Ddatabase < ../export.sql