feat: move SQL connection parameters into Env. vars
This commit is contained in:
parent
a7a7c738ec
commit
f02e6b3168
2 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,11 @@ services:
|
||||||
dockerfile: docker_dev/Dockerfile
|
dockerfile: docker_dev/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- 8081:80
|
- 8081:80
|
||||||
|
environment:
|
||||||
|
MYSQL_HOST: mysql
|
||||||
|
MYSQL_USER: root
|
||||||
|
MYSQL_PASSWORD: example
|
||||||
|
MYSQL_DATABASE: dragon_fire
|
||||||
develop:
|
develop:
|
||||||
watch:
|
watch:
|
||||||
- path: ./
|
- path: ./
|
||||||
|
|
|
@ -7,7 +7,8 @@ class MySQLAdapter {
|
||||||
public $data_directory;
|
public $data_directory;
|
||||||
|
|
||||||
function __construct() {
|
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';
|
$this->data_directory = 'raw';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue