ERROR: In file './docker-compose.yml', service 'build' must be a mapping not a string
Docker compose files are YAML files that require indentation, due to a wrong indentation in your compose file, Docker thinks that build is a service declaration. You've a similar question here and you can follow an example in Docker docs to check how the indentation works.