feat: move SQL connection parameters into Env. vars

This commit is contained in:
David Bailey 2023-12-11 23:04:49 +01:00
parent a7a7c738ec
commit f02e6b3168
2 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,11 @@ services:
dockerfile: docker_dev/Dockerfile
ports:
- 8081:80
environment:
MYSQL_HOST: mysql
MYSQL_USER: root
MYSQL_PASSWORD: example
MYSQL_DATABASE: dragon_fire
develop:
watch:
- path: ./

View file

@ -7,7 +7,8 @@ class MySQLAdapter {
public $data_directory;
function __construct() {
$this->raw = mysqli_connect('mysql', 'root', 'example', 'dragon_fire');
$this->raw = mysqli_connect(getenv('MYSQL_HOST'),
getenv('MYSQL_USER'), getenv('MYSQL_PASSWORD'), getenv('MYSQL_DATABASE'));
$this->data_directory = 'raw';