Mounting Font Packages for OnlyOffice
I. Create the Font Package Directory
-
Create the font package directory on the server and upload the font package.
mkdir -p /data/mingdao/script/volume/doc/font-packages- Store the font package in the
/data/mingdao/script/volume/doc/font-packagesdirectory.
- Store the font package in the
II. Configuration Steps
HAP Standalone Environment
-
Run
vim /data/mingdao/script/docker-compose.yamland add the mount- ./volume/doc/font-packages/:/usr/share/fonts/font-packages/.services:doc:image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0command: ["/bin/sh", "-c", "mkfontscale && mkfontdir && fc-cache -fv && exec /app/ds/run-document-server.sh"] # Addedvolumes: # Added- ./volume/doc/font-packages/:/usr/share/fonts/font-packages/ # Added -
Restart the
OnlyOfficeservice to apply the changes.Run the restart command from the manager directory.
bash ./service.sh restartall
Deploying OnlyOffice as a Standalone Docker Service
-
Run
vim doc.yamland add the mount- /data/mingdao/script/volume/doc/font-packages/:/usr/share/fonts/font-packages/.version: '3'services:doc:image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0command: ["/bin/sh", "-c", "mkfontscale && mkfontdir && fc-cache -fv && exec /app/ds/run-document-server.sh"] # Addedvolumes: # Added- /data/mingdao/script/volume/doc/font-packages/:/usr/share/fonts/font-packages/ # Added -
Restart the
OnlyOfficeservice to apply the changes.Run the restart command from the directory containing
doc.yaml.docker stack deploy -c doc.yaml doc
Deploying OnlyOffice on Kubernetes
Note: The font package directory creation step must be performed on every microservice node, and the font package must be uploaded on each node.
-
Update the mount configuration in the
docDeployment, usinghostPath.apiVersion: apps/v1kind: Deploymentmetadata:name: docnamespace: defaultspec:replicas: 1selector:matchLabels:app: docversion: defaulttemplate:metadata:labels:app: docversion: defaultannotations:md-update: "20230703103126"spec:containers:- name: docimage: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:2.0.0command: ["/bin/bash", "-c"] # Addedargs: ["mkfontscale && mkfontdir && fc-cache -fv && exec /app/ds/run-document-server.sh"] # Addedenv:- name: ENV_FILE_INNER_URIvalue: "www:8880"resources:limits:cpu: "4"memory: 2048Mirequests:cpu: "0.01"memory: 64MireadinessProbe:tcpSocket:port: 8000initialDelaySeconds: 10periodSeconds: 10livenessProbe:tcpSocket:port: 8000initialDelaySeconds: 180periodSeconds: 10volumeMounts: # Added- name: font-packages # AddedmountPath: /usr/share/fonts/font-packages/ # Addedvolumes: # Added- name: font-packages # AddedhostPath: # Addedpath: /data/mingdao/script/volume/doc/font-packages/ # Added -
Restart the
OnlyOfficeservice to apply the changes.Run the restart command from the directory containing
service.yaml.kubectl apply -f service.yaml# Check that the pod has startedkubectl get pods |grep doc# If ldoc has not restarted, manually trigger a rolling restartkubectl rollout restart deploy doc