start-container 558 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. if [ "$SUPERVISOR_PHP_USER" != "root" ] && [ "$SUPERVISOR_PHP_USER" != "sail" ]; then
  3. echo "You should set SUPERVISOR_PHP_USER to either 'sail' or 'root'."
  4. exit 1
  5. fi
  6. if [ ! -z "$WWWUSER" ]; then
  7. usermod -u $WWWUSER sail
  8. fi
  9. if [ ! -d /.composer ]; then
  10. mkdir /.composer
  11. fi
  12. chmod -R ugo+rw /.composer
  13. if [ $# -gt 0 ]; then
  14. if [ "$SUPERVISOR_PHP_USER" = "root" ]; then
  15. exec "$@"
  16. else
  17. exec gosu $WWWUSER "$@"
  18. fi
  19. else
  20. exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
  21. fi