Laravel sail command have no response except sail up and sail down
Asked Answered
S

3

8

I have a Laravel sail project but when I type sail command there is no reaction in console.

Only sail up and sail down work fine but other commands like sail shell, sail artisan ***, sail php -v ......donn`t response. No error and no any response.

I wonder what happened?

enter image description here

Soule answered 13/5, 2021 at 5:44 Comment(0)
C
21

If you renamed the laravel.test service to something else you may also set the APP_SERVICE variable in your .env file to match whatever you renamed it to, this will also work!

.docker-compose.yml

services:
    app.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.0
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.0/app
        ports:
            - '${APP_PORT:-80}:80'
        environment:
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - mysql
            - redis
            - selenium

.env

APP_SERVICE=app.test
Checkerwork answered 1/7, 2021 at 3:56 Comment(1)
This pointed me in the right direction; I don't know why, but I had to execute sail from vendor, instead of using the alias. ./vendor/bin/sail up -d did the trick. Thank you!Jud
S
2

Ok I know why. I have changed the name laravel.test in docker-compose.yml for a new name and it not worked. When I changed back it works again.

Soule answered 13/5, 2021 at 9:43 Comment(0)
G
2

You can define an ENV variable APP_SERVICE with the value same as you changed for laravel.test in docker-compose.file.

Git answered 4/12, 2021 at 21:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.