code-server: php-cli initial release

code-server: php-cli
Adding php-cli and composer to code-server container
This commit is contained in:
Christoph Friedrich
2024-03-13 09:01:20 +01:00
committed by Christoph Friedrich
parent 9d6b690c28
commit 148e54bc13
24 changed files with 155 additions and 104 deletions
@@ -0,0 +1,41 @@
#!/usr/bin/with-contenv bash
echo "**** Setting up PHP configuration files ****"
if [ ! -d /config/.php ]; then
cp -rf /etc/php /config/.php
chown -R abc:abc /config/.php
fi
rm -rf /etc/php
ln -s /config/.php /etc/php
if ! [ "${ENABLE_COMPOSER}" = "yes" ]; then
echo "**** Composer will not be installed ****"
exit 0
fi
echo "**** Installing Composer ****"
if ! command -v php &> /dev/null; then
echo "** Missing installed PHP! **"
exit 127;
fi
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
echo "** ERROR: Invalid installer checksum **"
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
if [ "${RESULT}" = "0" ]; then
echo "** Installing composer system wide **"
mv composer.phar /usr/local/bin/composer
fi
exit $RESULT
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-code-server-php-cli-install/run