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

chii
  • 2,111
  • 3
  • 17
  • 21

3 Answers3

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
Robert Kujawa
  • 967
  • 6
  • 21
  • 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! – funder7 Sep 22 '21 at 19:09
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.

chii
  • 2,111
  • 3
  • 17
  • 21
2

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

Faisal N
  • 21
  • 1