Documents, avatars and the encrypted app backups lived in ./uploads and ./backups inside the container and were lost on every restart. The backend now mounts the apicore-data volume at /data (configmap paths /data/documents and /data/backups). Both deployments pin the image to a CI build (sha-<commit>) with imagePullPolicy IfNotPresent instead of :latest, run as uid 1000 with seccomp RuntimeDefault, no privilege escalation and all capabilities dropped. The frontend gets a liveness probe. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: apicore-frontend
|
|
labels:
|
|
app: apicore-frontend
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: apicore-frontend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: apicore-frontend
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: apicore-frontend
|
|
# Fest auf einen Build pinnen (sha-<commit> aus der CI), siehe Backend.
|
|
image: git.encry.de/nick.rosenloecher/apicore-frontend:sha-REPLACE_ME
|
|
imagePullPolicy: IfNotPresent
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
drop: ["ALL"]
|
|
ports:
|
|
- containerPort: 3000
|
|
envFrom:
|
|
- configMapRef:
|
|
name: apicore-frontend-config
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
resources:
|
|
requests:
|
|
cpu: "0"
|
|
memory: "0"
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|