112 lines
2.9 KiB
YAML
112 lines
2.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: toonflow
|
|
labels:
|
|
app: toonflow
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: toonflow
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: toonflow
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: cr-pull-secret
|
|
initContainers:
|
|
- name: init-toonflow-data
|
|
image: ${CI_REGISTRY_IMAGE}/toonflow:latest
|
|
imagePullPolicy: Always
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
set -eu
|
|
mkdir -p /persist/assets /persist/oss /persist/logs /persist/modelPrompt /persist/skills /persist/vendor
|
|
[ -f /persist/db2.sqlite ] || : > /persist/db2.sqlite
|
|
for dir in assets modelPrompt skills vendor; do
|
|
if [ -d "/app/data/$dir" ] && [ -z "$(find "/persist/$dir" -mindepth 1 -maxdepth 1 2>/dev/null)" ]; then
|
|
cp -a "/app/data/$dir/." "/persist/$dir/"
|
|
fi
|
|
done
|
|
volumeMounts:
|
|
- name: toonflow-data
|
|
mountPath: /persist
|
|
containers:
|
|
- name: toonflow
|
|
image: ${CI_REGISTRY_IMAGE}/toonflow:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 10588
|
|
env:
|
|
- name: NODE_ENV
|
|
value: "prod"
|
|
- name: PORT
|
|
value: "10588"
|
|
- name: ossURL
|
|
value: "https://videoflow.airlabs.art"
|
|
volumeMounts:
|
|
- name: toonflow-data
|
|
mountPath: /app/data/db2.sqlite
|
|
subPath: db2.sqlite
|
|
- name: toonflow-data
|
|
mountPath: /app/data/oss
|
|
subPath: oss
|
|
- name: toonflow-data
|
|
mountPath: /app/data/assets
|
|
subPath: assets
|
|
- name: toonflow-data
|
|
mountPath: /app/data/logs
|
|
subPath: logs
|
|
- name: toonflow-data
|
|
mountPath: /app/data/modelPrompt
|
|
subPath: modelPrompt
|
|
- name: toonflow-data
|
|
mountPath: /app/data/skills
|
|
subPath: skills
|
|
- name: toonflow-data
|
|
mountPath: /app/data/vendor
|
|
subPath: vendor
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /favicon.ico
|
|
port: 10588
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 15
|
|
timeoutSeconds: 5
|
|
failureThreshold: 4
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /favicon.ico
|
|
port: 10588
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
resources:
|
|
requests:
|
|
memory: "1Gi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "4Gi"
|
|
cpu: "2"
|
|
volumes:
|
|
- name: toonflow-data
|
|
persistentVolumeClaim:
|
|
claimName: toonflow-data
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: toonflow
|
|
spec:
|
|
selector:
|
|
app: toonflow
|
|
ports:
|
|
- protocol: TCP
|
|
port: 10588
|
|
targetPort: 10588
|