Add secondary DB¶
If you need to add a secondary db, you need to use the docker-compose overrides functionality.
To do so, you should create a docker-compose.override.yml
file in the root of your folder. In that file, you should add the new service like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Then, you need to configure your application to use the new database:
Setting | Value |
---|---|
Host | secondarydb |
Port | 3306 |
Database | secondarydb |
Username | ${MYSQL_USER} |
Password | ${MYSQL_PASSWORD} |
Root Password | ${MYSQL_ROOT_PASSWORD} |