Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.89 KB | None | 0 0
  1. apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
  2. kind: Deployment
  3. metadata:
  4.   name: php-fpm-nginx
  5.   labels:
  6.     app: php-fpm-nginx
  7. spec:
  8.   selector:
  9.     matchLabels:
  10.       app: php-fpm-nginx
  11.   strategy:
  12.     type: Recreate
  13.   template:
  14.     metadata:
  15.       labels:
  16.         app: php-fpm-nginx
  17.     spec:
  18.       containers:
  19.        # Our PHP-FPM application
  20.         - image: php-custom
  21.           name: app
  22.           volumeMounts:
  23.             - name: shared-files
  24.               mountPath: /var/www/html
  25.       # Important! After this container has started, the PHP files
  26.       # in our Docker image aren't in the shared volume. We need to
  27.       # get them into the shared volume. If we tried to write directly
  28.       # to this volume from our Docker image the files wouldn't appear
  29.       # in the nginx container So, after the container has started, copy the PHP files from this
  30.       # container's local filesystem (/app -- added via the Docker image)
  31.       # totier: php-fpm-nginx the shared volume, which is mounted at /var/www/html.
  32.           lifecycle:
  33.             postStart:
  34.               exec:
  35.                 command: ["/bin/sh", "-c", "cp -rP /usr/src/mautic/. /var/www/html"]
  36.         # Our nginx container, which uses the configuration declared above,
  37.         # along with the files shared with the PHP-FPM app.
  38.         - image: nginx
  39.           name: nginx
  40.           volumeMounts:
  41.             - name: shared-files
  42.               mountPath: /var/www/html
  43.             - name: nginx-config-volume
  44.               mountPath: /etc/nginx/conf.d/
  45.               subPath: config.conf
  46.       volumes:
  47.        # Create the shared files volume to be used in both pods
  48.         - name: shared-files
  49.           emptyDir: {}
  50.  
  51.         # Add the ConfigMap we declared above as a volume for the pod
  52.         - name: nginx-config-volume
  53.           configMap:
  54.             name: nginx-config
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement