2
0

setup 1.4 KB

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