linux nginx postgres php
docker and compose
- Place php code in src directory.
- Add sql dump in postgres/db.sql
- Adjust database name username password in docker-compose.yml
- In you code connect to the database
$dsn = 'pgsql:dbname=' . getenv('DB_NAME') . ';host=db';
$username = getenv('DB_USER');
$password = getenv('DB_PASS');
$db = new PDO($dsn, $username, $password);
- Run
docker-compose up
=====================