Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1
- kind: Deployment
- metadata:
- name: php-fpm-nginx
- labels:
- app: php-fpm-nginx
- spec:
- selector:
- matchLabels:
- app: php-fpm-nginx
- strategy:
- type: Recreate
- template:
- metadata:
- labels:
- app: php-fpm-nginx
- spec:
- containers:
- # Our PHP-FPM application
- - image: php-custom
- name: app
- volumeMounts:
- - name: shared-files
- mountPath: /var/www/html
- # Important! After this container has started, the PHP files
- # in our Docker image aren't in the shared volume. We need to
- # get them into the shared volume. If we tried to write directly
- # to this volume from our Docker image the files wouldn't appear
- # in the nginx container So, after the container has started, copy the PHP files from this
- # container's local filesystem (/app -- added via the Docker image)
- # totier: php-fpm-nginx the shared volume, which is mounted at /var/www/html.
- lifecycle:
- postStart:
- exec:
- command: ["/bin/sh", "-c", "cp -rP /usr/src/mautic/. /var/www/html"]
- # Our nginx container, which uses the configuration declared above,
- # along with the files shared with the PHP-FPM app.
- - image: nginx
- name: nginx
- volumeMounts:
- - name: shared-files
- mountPath: /var/www/html
- - name: nginx-config-volume
- mountPath: /etc/nginx/conf.d/
- subPath: config.conf
- volumes:
- # Create the shared files volume to be used in both pods
- - name: shared-files
- emptyDir: {}
- # Add the ConfigMap we declared above as a volume for the pod
- - name: nginx-config-volume
- configMap:
- name: nginx-config
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement