partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

entrypoint.sh (588B)


      1 #!/bin/sh
      2 
      3 # Adopt the uid of the php user to the uid of the outer world.
      4 sed '/www-data/s@www-data:x:\([0-9]*\)@www-data:x:'"$GITHUB_DEBUG_UID@" -i /etc/passwd
      5 
      6 cd /var/www/pk
      7 
      8 # Allow www-data to use composer
      9 # This must be done after the uid of www-data has been alterd.
     10 mkdir /var/www/.composer && chown www-data: /var/www/.composer
     11 
     12 if [ "$1" = "docker-php-entrypoint" ]; then
     13 	# Do the preparation as user www-data
     14 	sudo -u www-data --preserve-env=COMPOSER_AUTH /user-entrypoint.sh
     15 	
     16 	exec "$@"
     17 else
     18 	echo "Calling manual command $@ as user www-data"
     19 	
     20 	sudo -u www-data -E "$@"
     21 fi