scanservjs: Deploy scanserv-js
*scanserv-js* is a web-based front-end for SANE. It allows scanning documents from a browser. Using the `config.local.js` file, we implement the `afterScan` hook to automatically upload scanned files to *paperless-ngx* using its REST API.
This commit is contained in:
118
scanservjs/scanservjs.yaml
Normal file
118
scanservjs/scanservjs.yaml
Normal file
@@ -0,0 +1,118 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: scanservjs
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: scanservjs
|
||||
app.kubernetes.io/component: scanservjs
|
||||
app.kubernetes.io/instance: scanservjs
|
||||
app.kubernetes.io/part-of: scanservjs
|
||||
name: scanservjs
|
||||
namespace: scanservjs
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8080
|
||||
selector:
|
||||
app.kubernetes.io/name: scanservjs
|
||||
app.kubernetes.io/component: scanservjs
|
||||
app.kubernetes.io/instance: scanservjs
|
||||
type: ClusterIP
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: scanservjs
|
||||
namespace: scanservjs
|
||||
labels:
|
||||
app.kubernetes.io/name: scanservjs
|
||||
app.kubernetes.io/component: scanservjs
|
||||
app.kubernetes.io/instance: scanservjs
|
||||
app.kubernetes.io/part-of: scanservjs
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: scanservjs
|
||||
app.kubernetes.io/component: scanservjs
|
||||
app.kubernetes.io/instance: scanservjs
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: scanservjs
|
||||
app.kubernetes.io/component: scanservjs
|
||||
app.kubernetes.io/instance: scanservjs
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init-data
|
||||
image: docker.io/sbs20/scanservjs:v2.26.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- cp
|
||||
- -r
|
||||
- /app/data/.
|
||||
- /tmp/data
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
readOnlyRootFilesystem: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
volumeMounts:
|
||||
- name: scanservjs-datadir
|
||||
mountPath: /tmp/data
|
||||
containers:
|
||||
- name: scanservjs
|
||||
image: docker.io/sbs20/scanservjs:v2.26.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: PAPERLESS_TOKEN_FILE
|
||||
value: /run/secrets/paperless.token
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: scanservjs
|
||||
optional: true
|
||||
ports:
|
||||
- name: scanservjs
|
||||
containerPort: 8080
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
readOnlyRootFilesystem: true
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
volumeMounts:
|
||||
- name: scanservjs-datadir
|
||||
mountPath: /app/data
|
||||
- name: scanservjs-configdir
|
||||
mountPath: /app/config
|
||||
- name: scanservjs-config
|
||||
mountPath: /app/config/config.local.js
|
||||
subPath: config.local.js
|
||||
- name: scanservjs-tmp
|
||||
mountPath: /tmp
|
||||
- name: paperless-token
|
||||
mountPath: /run/secrets/paperless.token
|
||||
subPath: paperless.token
|
||||
readOnly: true
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
volumes:
|
||||
- name: scanservjs-datadir
|
||||
emptyDir:
|
||||
- name: scanservjs-configdir
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
- name: scanservjs-tmp
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
- name: scanservjs-config
|
||||
configMap:
|
||||
name: scanservjs-config
|
||||
- name: paperless-token
|
||||
secret:
|
||||
secretName: paperless-token
|
||||
optional: true
|
||||
Reference in New Issue
Block a user