-
Add a custom entry for docker in
/etc/hosts
pointing to127.0.0.1
sudo echo -e "127.0.0.1\thost.docker.internal" >> /etc/hosts
-
Run the containers with the following command:
yarn up
-
Install
libmysqlclient
so rails are able to connect to the mysql DBsudo apt-get install libmysqlclient-dev
-
At the
DATABASE_URL
entries in the file.env
, swap all references of localhost for the custom host registered previouslysed -i 's/root@localhost/root@host.docker.internal/'
-
Edit the variable named
DATABASE_HOST
with the value of the custom host registered previouslyecho "DATABASE_HOST='host.docker.internal'" >> .env
In order to restore a database dump it's necessary that the file is compressed with zst
or xz
- Copy the compressed file to
.docker/dumps
- Enter the mysql container
yarn exec:mysql bash
- Execute the usual restore command with
/dumps/<filename>
as the file path