Hack composer into the entrypoint

This commit is contained in:
Luke Murphy 2020-10-15 16:26:32 +02:00
parent 08b5c1f53e
commit 33e70d62a4
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 12 additions and 1 deletions

View File

@ -6,7 +6,18 @@ init_db() {
set -eu
if ! type mysql > /dev/null 2>&1; then
apt update && apt install -y mariadb-client
apt update && apt install -y \
curl \
git \
mariadb-client \
php-cli \
unzip
curl -sS https://getcomposer.org/installer -o composer-setup.php
export HASH="a69df12e86a0a18fbedfc91a33d5f9acc5cf939576e0258326074fc1b2ee1aea"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Composer installer verified'; } else { echo 'Composer installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.15
composer -V
fi
PASSWORD=$(cat /run/secrets/db_password)