compose does not support 'deploy' configuration - use docker stack deploy to deploy to a swarm code example
Example: docker swarm deploy
docker stack deploy -c "path to compose" stackname
docker stack deploy -c "path to compose" stackname