3

sail shell并且sail artisan命令已停止工作。

但是sail up并且sail down仍在工作。

版本详情

php:8.0.5
laravel:8.41.0
帆:1.5.1
码头:3.3.3
操作系统:macOS 11.3.1

我的 docker-compose.yml 文件

# For more information: https://laravel.com/docs/sail
version: '3'
services:
    laravel.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
    mysql:
        image: 'mysql:8.0'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        volumes:
            - 'sailmysql:/var/lib/mysql'
        networks:
            - sail
        healthcheck:
          test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
    meilisearch:
        image: 'getmeili/meilisearch:latest'
        ports:
            - '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
        volumes:
            - 'sailmeilisearch:/data.ms'
        networks:
            - sail
    mailhog:
        image: 'mailhog/mailhog:latest'
        ports:
            - '${FORWARD_MAILHOG_PORT:-1025}:1025'
            - '${FORWARD_MAILHOG_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
    myadmin:
        image: 'phpmyadmin:latest'
        ports:
            - '${PHP_MYADMIN_PORT:-8080}:80'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
        links:
            - "mysql:db"
        depends_on:
            - mysql
        networks:
            - sail
networks:
    sail:
        driver: bridge
volumes:
    sailmysql:
        driver: local
    sailmeilisearch:
        driver: local

我的环境。文件

APP_PORT=81
FORWARD_DB_PORT=3305
PHP_MYADMIN_PORT=8081
FORWARD_MEILISEARCH_PORT=7701
FORWARD_MAILHOG_PORT=1026
FORWARD_MAILHOG_DASHBOARD_PORT=8026
WWWGROUP=1000
WWWUSER=1000

正如我们看到的那样,sail 命令在图像中不起作用,它返回空。

在此处输入图像描述

谢谢你。

4

1 回答 1

10

我认为问题在于服务的名称。该名称必须在文件 docker-compose.yml 和 .env 中匹配

1/ 停帆 > 下帆

2/码头工人-compose.yml

version: '3'

services:
    your-app.test:

3/ 在 .env 中添加这个

APP_SERVICE="your-app.test"

4/扬帆起航

于 2021-07-30T14:27:52.213 回答