Skip to content

Instantly share code, notes, and snippets.

@Punksolid
Created July 28, 2018 00:02
Show Gist options
  • Save Punksolid/9135c674daf69f3f4a63a5af93762ade to your computer and use it in GitHub Desktop.
Save Punksolid/9135c674daf69f3f4a63a5af93762ade to your computer and use it in GitHub Desktop.
Laravel App Deploy Basic Permission Configuration For Storage
container_commands:
01-migrations:
command: "php artisan migrate --force"
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/99_make_storage_writable.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo "Making /storage writeable..."
chmod -R 777 /var/app/current/storage
if [ ! -f /var/app/current/storage/logs/laravel.log ]; then
echo "Creating /storage/logs/laravel.log..."
touch /var/app/current/storage/logs/laravel.log
chown webapp:webapp /var/app/current/storage/logs/laravel.log
fi
if [ ! -d /var/app/current/public/storage ]; then
echo "Creating /public/storage symlink..."
ln -s /var/app/current/storage/app/public /var/app/current/public/storage
fi
"/opt/elasticbeanstalk/tasks/publishlogs.d/laravel-logs.conf":
mode: "000766"
owner: root
group: root
content: |
/var/app/current/storage/logs/*.log
"/etc/httpd/conf.d/https_redirect.conf":
mode: "000644"
owner: root
group: root
content: |
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} ^http$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=307,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment