instruction: Create a Dockerfile for Nginx with production best practices
output: ```dockerfile
  from a key-value pair:cat <<EOF >./kustomization.yaml
  secretGenerator:
  - name: example-secret-2
   literals:
   - username=admin
   - password=secret
  EOF
  The generated Secret is as follows:apiVersion: v1
  data:
   password: c2VjcmV0
   username: YWRtaW4=
  kind: Secret
  metadata:
   name: example-secret-2-t52t6g96d8
  type: Opaque
  Like ConfigMaps, generated Secrets can be used in Deployments by referring to the name of the secretGenerator:# Create a password.txt file
  cat <<EOF >./password.txt
  username=admin
  password=secret
  EOF
  
  cat <<EOF >deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
   name: my-app
   labels:
   app: my-app
  spec:
   selector:
   matchLabels:
   app: my-app
   template:
   metadata:
   labels:
   app: my-app
   spec:
   containers:
   - name: app
   image: my-app
   volumeMounts:
   - name: password
   mountPath: /secrets
   volumes:
   - name: password
   secret:
   secretName: example-secret-1
  EOF
  
  cat <<EOF >./kustomization.yaml
  resources:
  - deployment.yaml
  secretGenerator:
  - name: example-secret-1
   files:
   - password.txt
  EOF
  generatorOptionsThe generated ConfigMaps and Secrets have a content hash suffix appended. This ensures that
  a new ConfigMap or Secret is generated when the contents are changed. To disable the behavior
  of appending a suffix, one can use generatorOptions. Besides that, it is also possible to
  specify cross-cutting options for generated ConfigMaps and Secrets.cat <<EOF >./kustomization.yaml
  configMapGenerator:
  - name: example-configmap-3
   literals:
   - FOO=Bar
  generatorOptions:
   disableNameSuffixHash: true
   labels:
   type: generated
   annotations:
   note: generated
  EOF
  Runkubectl kustomize ./ to view the generated ConfigMap:apiVersion: v1
  data:
   FOO: Bar
  kind: ConfigMap
  metadata:
   annotations:
   note: generated
   labels:
   type: generated
   name: example-configmap-3
  Setting cross-cutting fieldsIt is quite common to set cross-cutting fields for all Kubernetes resources in a project.
  Some use cases for setting cross-cutting fields:setting the same namespace for all resourcesadding the same name prefix or suffixadding the same set of labelsadding the same set of annotationsHere is an example:# Create a deployment.yaml
  cat <<EOF >./deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
   name: nginx-deployment
   labels:
   app: nginx
  spec:
   selector:
   matchLabels:
   app: nginx
   template:
   metadata:
   labels:
   app: nginx
   spec:
   containers:
   - name: nginx
   image: nginx
  EOF
  
  cat <<EOF >./kustomization.yaml
  namespace: my-namespace
  namePrefix: dev-
  nameSuffix: "-001"
  labels:
   - pairs:
   app: bingo
   includeSelectors: true
  commonAnnotations:
   oncallPager: 800-555-1212
  resources:
  - deployment.yaml
  EOF
  Run kubectl kustomize ./ to view those fields are all set in the Deployment Resource:apiVersion: apps/v1
  kind: Deployment
  metadata:
   annotations:
   oncallPager: 800-555-1212
   labels:
   app: bingo
   name: dev-nginx-deployment-001
   namespace: my-namespace
  spec:
   selector:
   matchLabels:
   app: bingo
   template:
   metadata:
   annotations:
   oncallPager: 800-555-1212
   labels:
   app: bingo
   spec:
   containers:
   - image: nginx
   name: nginx
  Composing and Customizing ResourcesIt is common to compose a set of resources in a project and manage them inside the same file or directory.
  Kustomize offers composing resources
  ```