Пользуясь инструкцией с docs.docker.com, ввожу:
sudo docker-compose run web django-admin startproject composeexample
для создания проекта Django. Выдает ошибку:
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because
you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or
"3.3") and place your service definitions under the `services` key, or omit the `version` key and
place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
Файл docker-compose.yml (создан по той же инструкции):
version: "3.9"
services:
db:
image: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
Версия linux: 20.04.1. Версия docker: 20.10.3. Версия docker-compose: 1.25.0. Версия Python: 3.8.5.