Since this is the first result on Googling “docker-compose Unsupported config option for services”, I would like to add that the most common reason as of 2020 is missing of version: "3".
Just add version: "3" to the start of your docker-compose.yml.
From the docs:
There are currently three versions of the Compose file format:
- Version 1, the legacy format. This is specified by omitting a version key at the root of the YAML.
- Version 2.x. This is specified with a version: ‘2’ or version: ‘2.1’, etc., entry at the root of the YAML.
- Version 3.x, the latest and recommended version, designed to be cross-compatible between Compose and the Docker Engine’s swarm mode. This is specified with a version: ‘3’ or version: ‘3.1’, etc., entry at the root of the YAML.