2.5 KiB
Use external databases
Table of Contents
- local
Why
Some people or companies might have concerns with dockerized databases and rather rely on good old host-based database setups. There could already be a database cluster in your network or you rather want to use AWS RDS or other cloud-based solutions.
There are many reasons for having an external database.
Database on host os
Note
If the local database is listening on an IP address that is reachable over your current LAN, you can directly skip to: use_external_databases_database_on_network
In order to use an already existing database that is running on the host os, you need to make sure the following is met:
Be able to connect to the host os from inside the container
connect_to_host_os
Configure your application to use the IP/CNAME of the host os
When starting the Devilbox, explicitly specify the service to use and exclude the databases:
# Explicitly specify services to start (otherwise all will start) # Omit the database host> docker-compose up -d php httpd bind redis
start_the_devilbox
Database on network
In order to use an already existing database that is running on the network, you need to make sure the following is met:
Configure your application to use the IP/CNAME of the database host
When starting the Devilbox, explicitly specify the service to use and exclude the databases:
# Explicitly specify services to start (otherwise all will start) # Omit the database host> docker-compose up -d php httpd bind redis
start_the_devilbox
Database on internet
In order to use an already existing database that is running on the network, you need to make sure the following is met:
Configure your application to use the IP/CNAME of the database host
When starting the Devilbox, explicitly specify the service to use and exclude the databases:
# Explicitly specify services to start (otherwise all will start) # Omit the database host> docker-compose up -d php httpd bind redis
start_the_devilbox