953 0 0 0
Last Updated : 2025-04-28 22:12:23
When creating an Elastic beanstalk environment, you might do things such as see the logs generated from the EC2 instance, deploy a composer install, give permissions for FTP connections, Run a php artisan command, add something to .ebextensions ..etc. In this article we will list some of these commands.
container_commands:
01_write_permissions:
command: "sudo chown -R ec2-user:ec2-user /var/app/current"
02_ftp_permissions:
command: "sudo chmod -R 777 /var/app/current"
03_copy_env_file:
command: "cp /var/www/html/setupfiles/alpha/.env /var/www/html/"
04_move_to_root:
command: "cd /var/www/html/"
05_get_composer_file:
command: "sudo curl -sS https://getcomposer.org/installer | sudo php"
06_move_composer_file:
command: "sudo mv composer.phar /usr/local/bin/composer"
07_install_composer:
command: "sudo ln -s /usr/local/bin/composer /usr/bin/composer"
08_run_composer_install_for_app:
command: "sudo composer install"
09_app_key_generate:
command: "php artisan key:generate"
010_move_to_ec2user_root:
command: "cd /home/ec2-user/"
011_create_git_dir:
command: "mkdir Git"
012_move_to_git_dir:
command: "cd /home/ec2-user/Git/"
013_init_bare_git_repo:
command: "git init --bare myweb.git"
014_move_to_git_repo:
command: "cd /home/ec2-user/Git/myweb.git"
015_create_document_root_var:
command: "gwt=/var/www/html/"
016_echo_to_post_receive1:
command: "echo '#!/bin/sh' > hooks/post-receive"
017_echo_to_post_receive2:
command: "echo 'GIT_WORK_TREE=$gwt git checkout -f' >> hooks/post-receive"
018_grant_permission_to_post-receive:
command: "chmod +x hooks/post-receive"?
Read Also
- Create eloquent query based on different criteria [Content needed]
- Upload Image and validate on it on laravel
- Reset password for admin or user manually on Laravel
- Custom validation error messages
- Laravel - Send Email Example
- Laravel routes without index.php
- Laravel pagination problem when deleting last item
- Laravel pagination on array
- Auto logout after certain amount of inactivity
- Laravel Artisan summary