infra/k8s/invoiceninja/invoiceninja.yaml

148 lines
3.5 KiB
YAML
Raw Permalink 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:
2024-07-28 03:34:07 +00:00
securityContext:
fsGroup: 1500
fsGroupChangePolicy: "OnRootMismatch"
2024-02-18 02:26:37 +00:00
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
2024-07-28 03:34:07 +00:00
value: https://billing.janky.solutions/
2024-02-18 02:26:37 +00:00
- 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: nginx-config
configMap:
name: nginx-config
volumeClaimTemplates:
- metadata:
name: storage
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
2024-07-28 03:34:07 +00:00
storage: 1Gi
- metadata:
name: public
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
2024-02-18 02:26:37 +00:00
---
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;
2024-07-28 03:34:07 +00:00
fastcgi_param HTTPS on;
2024-02-18 02:26:37 +00:00
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}