2
0

setup 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. bin/stop
  3. docker-compose -f docker-compose.yml up -d
  4. sleep 1 #Ensure containers are started...
  5. echo "Copying all files from host to container..."
  6. rm -rf src/vendor #Clear for step below
  7. bin/copytocontainer --all
  8. bin/fixowns
  9. bin/clinotty chmod u+x bin/magento
  10. BASE_URL=${1:-magento2.test}
  11. echo "Forcing reinstall of composer deps to ensure perms & reqs..."
  12. bin/clinotty composer install
  13. bin/clinotty bin/magento setup:install \
  14. --db-host=db \
  15. --db-name=magento \
  16. --db-user=magento \
  17. --db-password=magento \
  18. --base-url=https://$BASE_URL/ \
  19. --admin-firstname=John \
  20. --admin-lastname=Smith \
  21. --admin-email=john.smith@gmail.com \
  22. --admin-user=john.smith \
  23. --admin-password=password123 \
  24. --language=en_US \
  25. --currency=USD \
  26. --timezone=America/New_York \
  27. --use-rewrites=1
  28. echo "Turning on developer mode.."
  29. bin/clinotty bin/magento deploy:mode:set developer
  30. bin/clinotty bin/magento indexer:reindex
  31. echo "Forcing deploy of static content to speed up initial requests..."
  32. bin/clinotty bin/magento setup:static-content:deploy -f
  33. echo "Clearing the cache for good measure..."
  34. bin/clinotty bin/magento cache:flush
  35. echo "Copying files from container to host after install..."
  36. bin/copyfromcontainer app
  37. bin/copyfromcontainer vendor
  38. echo "Restarting containers with host bind mounts for dev..."
  39. bin/restart
  40. echo "Docker development environment setup complete."