version: "3.5"

services:
    db:
        image: postgres:13
        restart: unless-stopped
        environment:
            - POSTGRES_DB=$DB_DATABASE
            - POSTGRES_USER=$DB_USERNAME
            - POSTGRES_PASSWORD=$DB_PASSWORD
        volumes:
            - $PWD/docker/initdb:/docker-entrypoint-initdb.d
            - $PWD/docker/conf/postgresql.conf:/etc/postgresql/postgresql.conf
        command: postgres -c config_file=/etc/postgresql/postgresql.conf
        ports:
            - ${EXT_DB_PORT:-5432}:5432
        networks:
            - bpdlh
            
    db-admin:
        image: adminer
        restart: unless-stopped
        ports:
            - ${EXT_DB_ADMIN_PORT:-8080}:8080
        depends_on:
            - db
        networks:
            - bpdlh

networks:
    bpdlh: