Django Docker compose无法为postgresql和redis创建容器

Django Docker compose无法为postgresql和redis创建容器,django,postgresql,docker,docker-compose,dockerfile,Django,Postgresql,Docker,Docker Compose,Dockerfile,我的docker compose有问题,无法为服务postgresql和redis创建容器,在运行docker compose up-d后,我出现以下错误: ERROR: for dockerizingdjango_postgres_1 Cannot create container for service postgres: b'invalid port specification: "None"' Creating dockerizingdjango_redis_1 ... Creati

我的
docker compose
有问题,无法为服务
postgresql
redis
创建容器,在运行
docker compose up-d
后,我出现以下错误:

ERROR: for dockerizingdjango_postgres_1  Cannot create container for service postgres: b'invalid port specification: "None"'
Creating dockerizingdjango_redis_1 ... 
Creating dockerizingdjango_redis_1 ... error
ERROR: for dockerizingdjango_redis_1  Cannot create container for service redis: b'invalid port specification: "None"'
ERROR: for postgres  Cannot create container for service postgres: b'invalid port specification: "None"'
ERROR: for redis  Cannot create container for service redis: b'invalid port specification: "None"'
ERROR: Encountered errors while bringing up the project.
docker compose.yml
文件如下所示:

web:
  restart: always
  build: ./web
  expose:
    - "8000"
  links:
    - postgres:postgres
    - redis:redis
  volumes:
    - /usr/src/app
    - /usr/src/app/static
  env_file: .env
  environment:
    DEBUG: 'true'
  command: /usr/local/bin/gunicorn docker_django.wsgi:application -w 2 -b :8000

apache:
  restart: always
  build: ./apache/
  ports:
    - "80:80"
  volumes:
    - /www/static
    - /www/media
  volumes_from:
    - web
  links:
    - web:web

postgres:
  restart: always
  image: postgres:latest
  ports:
    - "5432:5432"
  volumes:
    - pgdata:/var/lib/postgresql/data/

redis:
  restart: always
  image: redis:latest
  ports:
    - "6379:6379"
  volumes:
    - redisdata:/data
我正在使用此版本的
docker compose

docker-compose version 1.13.0, build 1719ceb
docker-py version: 2.3.0
CPython version: 3.4.3
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014

另外,我在这个容器中使用了
python3.5
,因为我在这个容器中提供django,所以有人能帮我解释一下这里发生了什么,以及如何解决这个问题吗,谢谢。

您似乎遇到了这个问题()。链接中提到的解决方法是降级或升级python。

您看到这个问题了吗?这个问题通过我的安装解决了,在读了这篇博文之后,
pip
installation给了我一个问题