#!/bin/bash set -e # if we're linked to MySQL, and we're using the root user, and our linked # container has a default "root" password set up and passed through... :) : ${DB_USERNAME:=root} if [ "$DB_USERNAME" = 'root' ]; then : ${DB_PASSWORD:=$MYSQL_ENV_MYSQL_ROOT_PASSWORD} fi echo "DB_USERNAME=$DB_USERNAME" >> .env echo "DB_PASSWORD=$DB_PASSWORD" >> .env chown www-data .env exec "$@"