infra/k8s/invoiceninja/invoiceninja.yaml

139 lines
3.3 KiB
YAML
Raw Normal View History

2024-02-18 02:26:37 +00:00
apiVersion: v1
kind: Service
metadata:
name: invoiceninja
namespace: invoiceninja
spec:
ports:
- name: web
port: 80
selector:
app: invoiceninja
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: invoiceninja
namespace: invoiceninja
spec:
selector:
matchLabels:
app: invoiceninja
serviceName: invoiceninja
replicas: 1
template:
metadata:
labels:
app: invoiceninja
spec:
containers:
- image: docker.io/invoiceninja/invoiceninja
name: invoiceninja
resources: {}
volumeMounts:
- name: public
mountPath: /var/www/app/public
- name: storage
mountPath: /var/www/app/storage
envFrom:
- secretRef:
name: invoiceninja
env:
- name: APP_URL
value: https://invoice-ninja.home.finn.io/
- name: APP_DEBUG
value: "true"
- name: REQUIRE_HTTPS
value: "false"
- name: DB_HOST
value: mysql
- name: DB_PORT
value: "3306"
- name: DB_DATABASE
value: ninja
- name: DB_USERNAME
value: ninja
- name: IN_USER_EMAIL
value: finn@janky.solutions
- name: IN_PASSWORD
value: aaa
- name: MAIL_HOST
value: mx1.janky.email
- name: MAIL_PORT
value: "587"
- name: MAIL_USERNAME
value: billing@janky.solutions
- name: MAIL_ENCRYPTION
value: tls
- name: MAIL_FROM_ADDRESS
value: billing@janky.solutions
- name: MAIL_FROM_NAME
value: Janky Solutions Billing
- image: nginx:latest
name: nginx
resources: {}
ports:
- name: web
containerPort: 80
volumeMounts:
- name: public
mountPath: /var/www/app/public
- name: nginx-config
mountPath: /etc/nginx/conf.d
volumes:
- name: public
emptyDir: {}
- name: nginx-config
configMap:
name: nginx-config
volumeClaimTemplates:
- metadata:
name: storage
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-config
namespace: invoiceninja
data:
nginx.conf: |
server {
listen 80 default_server;
server_name _;
server_tokens off;
client_max_body_size 100M;
root /var/www/app/public/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~* /storage/.*\.php$ {
return 401;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass localhost:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}