Levan explain it right: there are syntax errors in ports
and volumes
- to define list in yaml you need to have a space after dash (- something
) and not -something
.
But I want to add that if you want to check your configuration before start you should use command docker compose config
which would catch schema issues like this:
validating /path/to/docker-compose-linter/docker-compose.yml: services.app.volumes must be a list
Or special docker compose linter which also catch schema issues, but additionally could provide recommendations for improving your Compose file:
1:1 error ComposeValidationError: instancePath="/services/app/ports", schemaPath="#/properties/ports/type", message="Validation error: must be array". invalid-schema
✖ 1 problems (1 errors, 0 warnings)