run 477 B

1234567891011121314
  1. #!/bin/sh -e
  2. # Replace ENV vars in configuration files
  3. tmpfile=$(mktemp)
  4. cat /etc/php81/conf.d/custom.ini | envsubst "$(env | cut -d= -f1 | sed -e 's/^/$/')" | tee "$tmpfile" > /dev/null
  5. mv "$tmpfile" /etc/php81/conf.d/custom.ini
  6. tmpfile=$(mktemp)
  7. cat /etc/php81/php-fpm.d/www.conf | envsubst "$(env | cut -d= -f1 | sed -e 's/^/$/')" | tee "$tmpfile" > /dev/null
  8. mv "$tmpfile" /etc/php81/php-fpm.d/www.conf
  9. # pipe stderr to stdout and run php-fpm
  10. exec 2>&1
  11. exec php-fpm81 -F