在Docker Compose v3中不能用芹菜启动django

这是我的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, ie 'True'. 

我正在使用最新版本的docker和撰写。 另外我是新来撰写v3,并开始使用它来获得docker堆栈命令的可用性。 如果你在configuration文件中看到任何错误或redudant,请让我知道。 谢谢