无法在Docker Compose v3中使用芹菜启动django

无法在Docker Compose v3中使用芹菜启动django,docker,docker-compose,Docker,Docker Compose,这是我的docker-compose.yml: version: '3.4' services: nginx: restart: always image: nginx:latest ports: - 80:80 volumes: - ./misc/nginx.conf:/etc/nginx/conf.d/default.conf - /static:/static depends_on: - web

这是我的docker-compose.yml:

version: '3.4'

services:
  nginx:
    restart: always
    image: nginx:latest
    ports:
      - 80:80
    volumes:
      - ./misc/nginx.conf:/etc/nginx/conf.d/default.conf
      - /static:/static
    depends_on:
      - web

  web:
    restart: always
    image: celery-with-docker-compose:latest
    build: .
    command: bash -c "python /code/manage.py collectstatic --noinput && python /code/manage.py migrate && /code/run_gunicorn.sh"
    volumes:
      - /static:/data/web/static
      - /media:/data/web/media
      - .:/code
    env_file:
      - ./.env
    depends_on:
      - db
    volumes:
      - ./app:/deploy/app

  worker:
    image: celery-with-docker-compose:latest
    restart: always
    build:
      context: .
    command: bash -c "pip install -r /code/requirements.txt && /code/run_celery.sh"
    volumes:
      - .:/code
    env_file:
      - ./.env
    depends_on:
      - redis
      - web

  db:
    restart: always
    image: postgres
    env_file:
      - ./.env
    volumes:
      - pgdata:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  redis:
    restart: always
    image: redis:latest
    privileged: true
    command: bash -c "sysctl vm.overcommit_memory=1 && redis-server"
    ports:
      - "6379:6379"

volumes:
  pgdata:
当我运行
docker stack deploy-c docker-compose.yml cryptex时,我得到了

Non-string key at top level: true
docker-compose-f docker-compose.yml config
给了我

ERROR: In file './docker-compose.yml', the service name True must be a quoted string, i.e. 'True'.

我正在使用docker和compose的最新版本。另外,我是编写v3的新手,并开始使用它来获得docker stack命令的可用性。如果您在配置文件中看到任何错误或冗余,请告诉我。谢谢

您必须验证您的docker compose文件,可能是文件中的值较低

现在验证您的文件就像docker compose-f一样简单 docker-compose.yml配置。和往常一样,您可以省略-f docker-compose.yml部件,在与 文件本身或具有


似乎端口必须是服务区中带引号的字符串。e、 x:端口:-“80:80”