The fact that you need to manually run php artisan serve
suggests that the entrypoint or CMD in your Docker container isn't properly configured to automatically run the Laravel server.
docker-compose.yml
, remove the entrypoint field, since you're
already handling that in the Dockerfile.php artisan serve --host=0.0.0.0 --port=8000
. You may want to make sure that this command is being executed properly, especially after composer install
.