Skip to content

Instantly share code, notes, and snippets.

@IgorDePaula
Last active December 27, 2020 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IgorDePaula/7c99312b53dc26b08d0c93579a4f65b8 to your computer and use it in GitHub Desktop.
Save IgorDePaula/7c99312b53dc26b08d0c93579a4f65b8 to your computer and use it in GitHub Desktop.
Packer file to laravel on digital ocean
{
"variables": {
"do_api_token": "*******"
},
"builders": [
{
"type": "digitalocean",
"api_token": "{{user `do_api_token`}}",
"image": "ubuntu-20-04-x64",
"region": "nyc3",
"size": "512mb",
"ssh_username": "root",
"droplet_name":"laravel",
"snapshot_name":"laravel"
}],
"provisioners": [
{
"type": "shell",
"inline": [
"sleep 30",
"sudo apt-get update",
"sudo apt-get install -y apache2 php php-redis php-pdo php-mysql php-mbstring php-gd php-zip php-dom git sqlite3 php7.4-sqlite",
"sudo wget https://getcomposer.org/composer-stable.phar",
"sudo chmod +x composer-stable.phar",
"sudo a2enmod rewrite",
"sudo rm -Rf /var/www",
"sudo mv composer-stable.phar /usr/local/bin/composer",
"sudo git clone https://github.com/laravel/laravel.git /var/www",
"cd /var/www && cp -R public html",
"cd /var/www && composer install",
"cd /var/www && chmod -R 777 storage/",
"cd /var/www && cp .env.example .env",
"cd /var/www && php artisan key:generate",
"cd /var/www && touch database/database.sqlite"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment