read db var from env variable
This commit is contained in:
@@ -11,3 +11,8 @@ services:
|
||||
- "8061:80"
|
||||
environment:
|
||||
- APP_ENV=dev
|
||||
- DB_HOSTNAME=10.10.123.230
|
||||
- DB_PORT=5432
|
||||
- DB_USERNAME=postgres
|
||||
- DB_PASSWORD=rumbuk
|
||||
- DB_NAME=simdistu
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
// if ($conn->connect_error) {
|
||||
// die("Connection failed: " . $con->connect_error);
|
||||
// }
|
||||
$db_hostname = "10.10.123.230";
|
||||
$db_port = "5432";
|
||||
$db_username = "postgres";
|
||||
$db_password = "rumbuk";
|
||||
$db_name = "simdistu";
|
||||
$db_hostname = $_ENV['DB_HOSTNAME'];
|
||||
$db_port = $_ENV['DB_PORT'];
|
||||
$db_username = $_ENV['DB_USERNAME'];
|
||||
$db_password = $_ENV['DB_PASSWORD'];
|
||||
$db_name = $_ENV['DB_NAME'];
|
||||
|
||||
$koneksi = pg_connect("host=$db_hostname port=$db_port dbname=$db_name user=$db_username password=$db_password");
|
||||
|
||||
|
||||
2
src/health.php
Normal file
2
src/health.php
Normal file
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
echo("ok");
|
||||
Reference in New Issue
Block a user