-
-
Save ibraah88/2655223d322648f1ee12d06c5a25c7e6 to your computer and use it in GitHub Desktop.
Example Laravel deployment for Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: platform-api | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: platform-api | |
template: | |
metadata: | |
labels: | |
app: platform-api | |
commit: [INSERTED_DURING_CI] | |
spec: | |
containers: | |
- name: app | |
image: us.gcr.io/nexmillio/platform-api:latest | |
imagePullPolicy: Always | |
ports: | |
- {containerPort: 80} | |
env: | |
- { name: "APP_ENV", value: "production" } | |
- { name: "APP_DEBUG", value: "false" } | |
- { name: "APP_KEY", valueFrom: { secretKeyRef: { name: platform-api-secrets, key: app.key }} } | |
- { name: "APP_TIMEZONE", value: "UTC" } | |
- { name: "HASH_ID_SECRET", valueFrom: { secretKeyRef: { name: platform-api-secrets, key: hash.id.secret }} } | |
livenessProbe: | |
httpGet: | |
path: /healthz | |
port: 80 | |
initialDelaySeconds: 10 | |
timeoutSeconds: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1-apache | |
ADD . /var/www | |
ADD ./site.conf /etc/apache2/sites-enabled/000-default.conf | |
RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && \ | |
docker-php-ext-install mcrypt pdo_mysql opcache && \ | |
pecl install redis-3.1.2 && docker-php-ext-enable redis && \ | |
a2enmod rewrite | |
WORKDIR /var/www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: platform-api-secrets | |
data: | |
app.key: [BASE64_VALUE] | |
hash.id.secret: [BASE64_VALUE] | |
db.password: [BASE64_VALUE] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: platform-api | |
spec: | |
selector: | |
app: platform-api | |
ports: | |
- protocol: TCP | |
port: 80 | |
type: NodePort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment