mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2025-12-31 19:47:25 +01:00
18 lines
395 B
Bash
18 lines
395 B
Bash
#!/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 "$@"
|