Skip to content

Instantly share code, notes, and snippets.

@fmtarif
Created June 24, 2021 19:14
Show Gist options
  • Save fmtarif/11a3e773715bf76706941e75ceec2146 to your computer and use it in GitHub Desktop.
Save fmtarif/11a3e773715bf76706941e75ceec2146 to your computer and use it in GitHub Desktop.
#cli #bash #server take a php project git repo and deploy it in containers using easyengine (ee)
#!/bin/bash
#take a php project git repo and deploy it in containers using easyengine (ee)
set -e
domain="example.com"
app_path="/opt/easyengine/sites/${domain}/app/htdocs"
gitrepo="https://github.com/laravel/laravel.git"
doc_root_realive_to_app_path="public"
#install easyengine if not already installed
#wget -qO ee https://rt.cx/ee4 && sudo bash ee
ee site create ${domain} --type=php --public-dir=${doc_root_realive_to_app_path} --php=7.3
cd ${app_path}
git clone --depth 1 ${gitrepo} repo
chown -R www-data:www-data ${app_path}
cp .env.example .env
docker exec -it ${domain//./}_php_1 composer install --prefer-dist --no-scripts --no-dev -q -o
docker exec -it ${domain//./}_php_1 php artisan key:generate && php artisan migrate:fresh --seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment