instruction: Create a comprehensive Dockerfile for networking applications with best practices
output: ```dockerfile
  from your Active Directory (AD) instance:
  
  $ name="mygmsa"
  $ contents="{...}"
  $ echo $contents > contents.json
  Make sure that the nodes to which you are deploying are correctly configured for the gMSA.To use a config as a credential spec, create a Docker config in a credential spec file named credpspec.json.
  You can specify any name for the name of the config.
  
  $ docker config create --label com.docker.gmsa.name=mygmsa credspec credspec.json
  Now you can create a service using this credential spec. Specify the --credential-spec flag with the config name:
  
  $ docker service create --credential-spec="config://credspec" <your image>
  Your service uses the gMSA credential spec when it starts, but unlike a typical Docker config (used by passing the --config flag), the credential spec is not mounted into the container.Update a serviceYou can change almost everything about an existing service using the
  docker service update command. When you update a service, Docker stops its
  containers and restarts them with the new configuration.Since Nginx is a web service, it works much better if you publish port 80
  to clients outside the swarm. You can specify this when you create the service,
  using the -p or --publish flag. When updating an existing service, the flag
  is --publish-add. There is also a --publish-rm flag to remove a port that
  was previously published.Assuming that the my_web service
  ```