#!/bin/bash # Parse DATABASE_URL if [ -n "$DATABASE_URL" ]; then export SYMFONY__ENV__DATABASE_DRIVER=$(echo $DATABASE_URL | sed -e 's,^\(.*\)://.*,\\1,g') export SYMFONY__ENV__DATABASE_USER=$(echo $DATABASE_URL | sed -e 's,.*://\([^:]*\):.*,\1,g') export SYMFONY__ENV__DATABASE_PASSWORD=$(echo $DATABASE_URL | sed -e 's,.*:.\([^@]*\)@.*,\\1,g') export SYMFONY__ENV__DATABASE_HOST=$(echo $DATABASE_URL | sed -e 's,.*@\([^:]*\):.*,\\1,g') export SYMFONY__ENV__DATABASE_PORT=$(echo $DATABASE_URL | sed -e 's,.*:\([^/]*\)/.*,\\1,g') export SYMFONY__ENV__DATABASE_NAME=$(echo $DATABASE_URL | sed -e 's,.*\/\([^?]*\).*,\\1,g') fi # Call the original entrypoint exec docker-php-entrypoint "$@"