Implement Laravel's production optimizations
This commit is contained in:
parent
f520b8a0d0
commit
16786bac64
@ -1,3 +1,4 @@
|
||||
/.git
|
||||
/build
|
||||
/node_modules
|
||||
/public/css
|
||||
@ -14,5 +15,10 @@
|
||||
!/storage/logs/.gitignore
|
||||
/tests
|
||||
/vendor
|
||||
.dockerignore
|
||||
.editorconfig
|
||||
.env
|
||||
.gitattributes
|
||||
.styleci.yml
|
||||
phpunit.xml
|
||||
yarn-error-log
|
||||
|
||||
@ -27,4 +27,7 @@ RUN npm install --global yarn && \
|
||||
rm -rf node_modules/
|
||||
|
||||
RUN find storage -type d -exec chmod 777 {} \; && \
|
||||
find storage -type f -exec chmod 666 {} \; \
|
||||
find storage -type f -exec chmod 666 {} \;
|
||||
|
||||
ENTRYPOINT ["./docker-entrypoint.sh"]
|
||||
CMD ["apache2-foreground"]
|
||||
|
||||
17
docker-entrypoint.sh
Executable file
17
docker-entrypoint.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# first arg is `-f` or `--some-option`
|
||||
if [ "${1#-}" != "$1" ]; then
|
||||
set -- apache2-foreground "$@"
|
||||
fi
|
||||
|
||||
php artisan cache:clear
|
||||
php artisan config:cache
|
||||
php artisan route:cache
|
||||
php artisan event:cache
|
||||
php artisan view:cache
|
||||
|
||||
php artisan migrate --force
|
||||
|
||||
exec "$@"
|
||||
Loading…
Reference in New Issue
Block a user