Docker compose V3 Swarm and ElasticSeach

Hi.
I am trying to deploy ElasticSeach 5.4.2 on a docker swarm.
If I create a container with a docker-compose file with command:
command: ["/bin/bash", "bin/es-docker"]
I receive no errors and elasticseach is up.
I I try to deploy elasticseach on docker swam I receive these errors:
escluster_elasticsearch.1.t6amgtgq7lrk@solar-asdp-02.solar.altecspace.it | /bin/bash: bin/es-docker: No such file or directory
escluster_elasticsearch.1.ps8elo9yylzc@solar-asdp-02.solar.altecspace.it | /bin/bash: bin/es-docker: No such file or directory

Why do bin/es-docker not exists in swam mode?
What is the problem? What are mistakes I do?
Bye