Skip to content

Add pdo env to php images if they are depended #1

@prolic

Description

@prolic

moved from prooph/micro#22

Scenario

  1. User creates a postgres/mysql database (./bin/micro micro:setup:postgres)
  2. User creates a php-service and selects this postgres database as dependend (./bin/micro micro:setup:php-service)

Feature Request

All MySQL and PostgreSQL databases created by micro cli commands, have a label prooph-pdo:true in the docker-compose.yml.

When the php-service is created, it should check for the prooph-pdo label and add the following environment variables to the php-image:

PROOPH_PDO_DSN=pgsql:host=postgres port=5432 dbname=micro_do
PROOPH_PDO_USER=postgres
PROOPH_PDO_PWD=

with the values of host name, port number, dbname, user & password taken from the docker-compose.yml file

Goal

In the PHP service you can create a database connection very easy with the given environment variables, so no additonal config is required for this service.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions