Skip to content

Fix: Add missing composer install, .env setup, and Laravel artisan bootstrap to Docker entrypoint #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ WORKDIR /var/www

#entrypoint
ENTRYPOINT ["entrypoint.sh"]
CMD ["php-fpm"]
CMD ["php-fpm"]
16 changes: 15 additions & 1 deletion .docker/php/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ set -e
chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
chmod -R 775 /var/www/storage /var/www/bootstrap/cache

if [ ! -d "/var/www/vendor" ]; then
composer install
fi

if [ -f /var/www/artisan ]; then
if [ ! -f /var/www/.env ] && [ -f /var/www/.env.example ]; then
cp /var/www/.env.example /var/www/.env
fi
php /var/www/artisan key:generate --force
php /var/www/artisan config:cache

php /var/www/artisan migrate --force
fi

# permissions for PHPMyAdmin
mkdir -p /sessions

chmod 777 /sessions

exec "$@"
exec "$@"
Empty file modified bootstrap/cache/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/app/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/app/private/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/app/public/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/cache/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/cache/data/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/sessions/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/testing/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/framework/views/.gitignore
100644 → 100755
Empty file.
Empty file modified storage/logs/.gitignore
100644 → 100755
Empty file.