Implement Laravel's production optimizations

This commit is contained in:
Daniel_I_Am 2021-09-03 17:25:00 +02:00
parent f520b8a0d0
commit 16786bac64
3 changed files with 27 additions and 1 deletions

View File

@ -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

View File

@ -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
View 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 "$@"