How to deploy LibreOffice
Configuration in HAP Standalone Environment
-
Download the mirror (Offline package)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-ldoc:2.0.2 -
Edit the docker-compose.yaml file. Add environment variables and service configurations as shown below.
The default path of the docker-compose.yaml file is /data/mingdao/script/docker-compose.yaml.
services:
app:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-hap:7.2.0
environment:
ENV_DOCPREVIRE_EXT_ENDPOINTS: "ldoc:8000" # Add environment variable
# Add service configuration
ldoc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-ldoc:2.0.2 -
Restart the HAP microservice.
Standalone deployment of ldoc services based on Docker
-
Download the mirror (Offline package)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-ldoc:2.0.2 -
Initialize Docker Swarm (skip if already initialized)
docker swarm init -
Create a
ldoc.yamlfile in any directory with the following content:version: '3'
services:
ldoc:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-ldoc:2.0.2
ports:
- 8881:8000 -
Start the ldoc document preview service. Execute the following command in the directory where
ldoc.yamlis located:docker stack deploy -c ldoc.yaml ldocTo remove the service, you can run
docker stack rm ldoc. -
Add environment variable to the corresponding
docker-compose.yamlfile of the microservice (default path is/data/mingdao/script/docker-compose.yaml).ENV_DOCPREVIRE_EXT_ENDPOINTS: "Internal address of ldoc service, e.g., 172.27.0.13:8881" -
Restart the HAP microservice.
Deployment of ldoc services based on Kubernetes
-
The cluster environment for HAP microservices is based on Kubernetes by default. To integrate ldoc service, you can deploy it using the following configuration file:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ldoc
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: ldoc
template:
metadata:
labels:
app: ldoc
spec:
containers:
- name: ldoc
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-ldoc:2.0.2
resources:
limits:
cpu: "4"
memory: 4096Mi
requests:
cpu: "0.01"
memory: 64Mi
readinessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 8000
initialDelaySeconds: 180
periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
name: ldoc
namespace: default
spec:
selector:
app: ldoc
ports:
- name: internal
port: 8001
targetPort: 8000-
In the above configuration, the value of the ENV_FILE_INNER_URI variable is www:8880, which accesses the www service through internal container communication. If the deployment environment of ldoc service is not in the same namespace or environment as the HAP microservice, this variable value needs to be changed to the internal network address of the HAP system.
-
Other services to access ldoc, defined here in service it is also through the container internal communication. Similarly, if they are not in the same namespace or environment, change it to the nodePort method and configure the microservice to connect to the external address of ldoc.
-
-
Add variables in config.yaml.
ENV_DOCPREVIRE_EXT_ENDPOINTS: "ldoc:8001" -
Restart the HAP microservice.