Docker compose错误未找到api_php_1的容器

Docker compose错误未找到api_php_1的容器,php,docker,symfony,Php,Docker,Symfony,我有个问题。当我在“docker compose up-d”之后执行“docker compose exec php bin/console条令:模式:更新”时,我收到以下消息: “错误:未找到api_php_1的容器” 问题是什么 version: '3.4' services: php: image: ${CONTAINER_REGISTRY_BASE}/php build: context: ./api target: api_platform

我有个问题。当我在“docker compose up-d”之后执行“docker compose exec php bin/console条令:模式:更新”时,我收到以下消息: “错误:未找到api_php_1的容器”

问题是什么

version: '3.4'

services:
  php:
    image: ${CONTAINER_REGISTRY_BASE}/php
    build:
      context: ./api
      target: api_platform_php
      cache_from:
        - ${CONTAINER_REGISTRY_BASE}/php
    healthcheck:
      interval: 10s
      timeout: 3s
      retries: 3
      start_period: 30s
    depends_on:
      - db
    env_file:
      - ./api/.env
    # Comment out these volumes in production
    volumes:
      - ./api:/srv/api:cached
      - ./api/vendor:/srv/api/vendor:delegated
      # If you develop on Linux, uncomment the following line to use a bind-mounted host directory instead
      # - ./api/var:/srv/api/var:rw
      - php-data:/srv/api/var/cache
      - php-data:/srv/api/var/log

  api:
    image: ${CONTAINER_REGISTRY_BASE}/nginx
    build:
      context: ./api
      target: api_platform_nginx
      cache_from:
        - ${CONTAINER_REGISTRY_BASE}/nginx
    depends_on:
      - php
    # Comment out this volume in production
    volumes:
      - ./api/public:/srv/api/public:ro
    ports:
      - "8080:80"
      - "8888:443"


这不是我的项目,我是Docker的新手

使用
Docker ps-a检查Docker容器状态
如果状态
已退出
则在创建容器时出错使用
Docker ps-a检查Docker容器状态
如果状态
已退出
则在创建容器时出错康蒂纳