diff --git a/.dockerignore b/.dockerignore index 7248b1a..da16e76 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/Dockerfile b/Dockerfile index d619544..cbf0a01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..0388e11 --- /dev/null +++ b/docker-entrypoint.sh @@ -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 "$@"