instruction: Create a comprehensive Dockerfile for networking applications with best practices
output: ```dockerfile
  from
  the point of view of a service.PrerequisitesThis tutorial requires three physical or virtual Docker hosts which can all
  communicate with one another. This tutorial assumes that the three hosts are
  running on the same network with no firewall involved.These hosts will be referred to as manager, worker-1, and worker-2. The
  manager host will function as both a manager and a worker, which means it can
  both run service tasks and manage the swarm. worker-1 and worker-2 will
  function as workers only,If you don't have three hosts handy, an easy solution is to set up three
  Ubuntu hosts on a cloud provider such as Amazon EC2, all on the same network
  with all communications allowed to all hosts on that network (using a mechanism
  such as EC2 security groups), and then to follow the
  installation instructions for Docker Engine - Community on Ubuntu.WalkthroughCreate the swarmAt the end of this procedure, all three Docker hosts will be joined to the swarm
  and will be connected together using an overlay network called ingress.On manager. initialize the swarm. If the host only has one network
  interface, the --advertise-addr flag is optional.
  
  $ docker swarm init --advertise-addr=<IP-ADDRESS-OF-MANAGER>
  Make a note of the text that is printed, as this contains the token that
  you will use to join worker-1 and worker-2 to the swarm. It is a good
  idea to store the token in a password manager.On worker-1, join the swarm. If the host only has one network interface,
  the --advertise-addr flag is optional.
  
  $ docker swarm join --token <TOKEN> \
   --advertise-addr <IP-ADDRESS-OF-WORKER-1> \
   <IP-ADDRESS-OF-MANAGER>:2377
  On worker-2, join the swarm. If the host only has one network interface,
  the --advertise-addr flag is optional.
  
  $ docker swarm join --token <TOKEN> \
   --advertise-addr <IP-ADDRESS-OF-WORKER-2> \
   <IP-ADDRESS-OF-MANAGER>:2377
  On manager, list all the nodes. This command can only be done
  ```