How to use docker-compose to restore fresh databases quickly for integration tests?
问题 I would like to run integration and end-to-end tests with a database in a known state for each run, to make the tests independent and repeatable. An easy way of doing this is to use docker-compose to create a database container which loads the scheme and data from a dump file each time. However, this is far too slow to restore the database for every test. A better way seems to be to restore the database once in a docker container or volume, and then copy (mount?) the container/volume database