You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

1 month ago
  1. #!/bin/sh
  2. FILE=.env
  3. if [ ! -f "$FILE" ]; then
  4. echo 'Creating .env file...'
  5. cp .env.example .env
  6. fi
  7. echo "Building docker image..."
  8. docker build -t="redq/php81-composer" .
  9. echo "Installing composer dependencies..."
  10. docker run --rm \
  11. -v $(pwd):/opt \
  12. -w /opt \
  13. redq/php81-composer:latest \
  14. composer install
  15. echo "Stopping running sail container if any..."
  16. ./vendor/bin/sail down
  17. echo "Starting app container..."
  18. ./vendor/bin/sail up -d
  19. echo "Generating application key..."
  20. ./vendor/bin/sail artisan key:generate
  21. sleep 30 & PID=$! #simulate a long process
  22. echo "Processing please be patient..."
  23. printf "["
  24. # While process is running...
  25. while kill -0 $PID 2> /dev/null; do
  26. printf "▇"
  27. sleep 1
  28. done
  29. echo "]"
  30. echo "Installing marvel dependncies..."
  31. ./vendor/bin/sail artisan marvel:install
  32. FILE=public/storage
  33. if [ ! -h "$FILE" ]; then
  34. echo "Linking storage path..."
  35. ./vendor/bin/sail artisan storage:link
  36. fi
  37. echo "Installation Successful!"
  38. echo "- GraphQL Playground Endpoint: http://localhost/playground"
  39. echo "- Graphql Endpoint: http://localhost/graphql"
  40. echo "- REST Endpoint: http://localhost/"