Skip to content

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

Open
fuadadhim24 wants to merge 1 commit into
refactorian:mainfrom
fuadadhim24:fix/docker-entrypoint-bootstrap
Open

Fix: Add missing composer install, .env setup, and Laravel artisan bootstrap to Docker entrypoint#272
fuadadhim24 wants to merge 1 commit into
refactorian:mainfrom
fuadadhim24:fix/docker-entrypoint-bootstrap

Conversation

@fuadadhim24

@fuadadhim24 fuadadhim24 commented Jul 28, 2025

Copy link
Copy Markdown

What’s Fixed

This PR addresses two issues encountered during Docker container startup in a Laravel project:

  1. Missing vendor autoload error:
    Laravel fails with Failed opening required 'vendor/autoload.php' if composer install hasn't run.

    • Fix: Automatically run composer install if /var/www/vendor does not exist.
  2. Missing .env file and uninitialized Laravel app:
    Without .env, php artisan key:generate and other commands fail.

    • Fix: Copy .env.example to .env if needed, generate app key, cache config, and run migrations.

Why It Matters

Without these steps, fresh containers fail to start properly unless manually set up. These changes make the container self-initializing and reduce setup time for new developers or CI environments.

How to Test

  1. Build and run the container:
    docker-compose up --build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant