Skip to content

Instantly share code, notes, and snippets.

@oceanapplications
Last active August 22, 2021 17:56
Show Gist options
  • Save oceanapplications/965c595555794c2dfd7a0bd546464008 to your computer and use it in GitHub Desktop.
Save oceanapplications/965c595555794c2dfd7a0bd546464008 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
name: php
labels:
tier: backend
spec:
replicas: 1
selector:
matchLabels:
app: nginx
tier: backend
template:
metadata:
labels:
app: nginx
tier: backend
spec:
enableServiceLinks: false
containers:
- name: php
image: s937717/laravel
imagePullPolicy: Always
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: password
name: mysql-password
envFrom:
- configMapRef:
name: laravel-env
volumeMounts:
- name: code
mountPath: /code
lifecycle:
postStart:
exec:
command: [ "/bin/sh", "-c", "cp -r /var/www/html/. /code" ]
- name: nginx
image: nginx:1.21.0
ports:
- containerPort: 80
volumeMounts:
- name: config
mountPath: /etc/nginx/conf.d
- name: code
mountPath: /code
imagePullSecrets:
- name: regcred
volumes:
- name: config
configMap:
name: nginx-config
items:
- key: config
path: site.conf
- name: code
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment