Detailed process of installing and deploying onlyoffice in docker

Detailed process of installing and deploying onlyoffice in docker

0. System requirements

CPU I5-10400F or above

Memory 16 GB, 32 GB memory is best

At least 40 GB of free space on your hard drive

1: Install Docker Desktop

2: Enter BIOS to set CPU virtualization

https://jingyan.baidu.com/article/ab0b56305f2882c15afa7dda.html

3: Start Docker desktop

Error solution: https://www.jb51.net/article/214820.htm

3: Enter cmd and use the command to install onlyoffice

Install the universal version:

docker pull hub.c.163.com/gongzh/onlyoffice:latest

run

docker run -i -t -d -p 8702:80 hub.c.163.com/gongzh/onlyoffice

Install the community version [free]:

docker run -i -t -d -p 8703:80 --restart=always onlyoffice/documentserver

To view the container, enter docker ps ,

Enter the container, docker exec -i -t e15 /bin/bash [e15 is the container ID]

Install the Chinese package, onlyoffice Chinese font package, unzip and run docker_run.sh

4:123.rar file is the code for editing word, onlyoffceExample is the code for accepting files

https://gitee.com/zhuhaos/onlyoffice/repository/archive/master.zip

5: H5 page configuration, [must use IP address instead of localhost]

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <meta charset="utf-8" />

    <title></title>

</head>

<body style="height:900px;">

    <div id="placeholder" style="height:880px;"></div>

    <script type="text/javascript" src="http://192.168.1.140:8703/web-apps/apps/api/documents/api.js"></script>

    <script type="text/javascript">

        var config = {

            "editorConfig": {

                "lang": "zh-CN",

                "mode": "edit",

            },

            "document": {

                "fileType": "docx",

                "key": "Khirzs6zTPdfd27",

                "title": "Example Document Title.docx",

                "url": "http://192.168.1.140/1234.docx", //Fill in the document URL path here},

            "documentType": "text",

            "lang": "zh-CN",

        };

        var docEditor = new DocsAPI.DocEditor("placeholder", config);

    </script>

</body>

</html>

6: The existing problem must use the [Community Version], one is [Chinese font]
7: After closing the page, the callback is automatically saved.

body:{"key":"12NAFE","status":2,"url":"http://192.168.1.140:8702/cache/files/12NAFE_3573/output.docx/output.docx?md5=Ig6ycB-dGH708fuNDt-Tsg==&expires=1623199603&disposition=attachment&ooname=output.docx","changesurl":"http://192.168.1.140:8702/cache/files/12NAFE_3573/changes.zip/changes.zip?md5=asEzUMiPjS5a-17wxp7oPA==&expires=1623199603&disposition=attachment&ooname=output.zip","history":
{"serverVersion":"5.1.3","changes":
[{"created":"2021-06-09 00:16:31","user":
{"id":"uid-1623197783691","name":"Anonymous"
}},
{"created":"2021-06-09 00:16:43","user":
{"id":"uid-1623197795750","name":"Anonymous"
}},{"created":"2021-06-09 00:24:48","user":
{"id":"uid-1623198283436","name":"Anonymous"
}}]},"users":["uid-1623198283436"],"actions":
[{"type":0,"userid":"uid-1623198542944"
}],"lastsave":"2021-06-09T00:27:54.050Z","notmodified":false
}

8: File receiving key code [general processing procedure]

public void ProcessRequest(HttpContext context)

        {

 

            string body;

            using (var reader = new StreamReader(context.Request.InputStream))

                body = reader.ReadToEnd();

            var fileData = new JavaScriptSerializer().Deserialize<Dictionary<string, object>>(body);

            if (fileData != null && fileData["status"].ToString() == "2")

            {

                var req = WebRequest.Create((string)fileData["url"]);

                string PATH_FOR_SAVE = context.Server.MapPath("~/temp/") + DateTime.Now.ToString("yyyyMMddhhmmss") + ".docx";

                using (var stream = req.GetResponse().GetResponseStream())

                using (var fs = File.Open(PATH_FOR_SAVE, FileMode.Create))

                {

                    var buffer = new byte[4096];

                    int readed;

                    while ((readed = stream.Read(buffer, 0, 4096)) != 0)

                        fs.Write(buffer, 0, readed);

                }

            }

            context.Response.Write("{\"error\":0}");

        }

The above is the details of docker deployment of onlyoffice. For more information about docker deployment of onlyoffice, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Ubuntu Docker installation, deployment and simple application
  • Docker installation and deployment on CentOS7 system and basic tutorial
  • Detailed explanation of the construction and use of Docker private warehouse
  • Detailed explanation of CentOS 7: Docker private warehouse construction and use
  • Detailed steps to build a Docker Registry private warehouse
  • Docker basic commands from installation to application deployment and private warehouse construction

<<:  The benefits and examples of placing the site map at the bottom of the web page

>>:  Pure CSS to add style to select (no script) implementation

Recommend

Detailed explanation of MySQL backup process using Xtrabackup

Table of contents 01 Background 02 Introduction 0...

Detailed analysis of the MySQL slow log opening method and storage format

In development projects, we can monitor SQL with ...

Example of how to build a Mysql cluster with docker

Docker basic instructions: Update Packages yum -y...

Detailed explanation of Xshell common problems and related configurations

This article introduces common problems of Xshell...

Solve the problem of using linuxdeployqt to package Qt programs in Ubuntu

I wrote some Qt interface programs, but found it ...

How to use CSS to achieve data hotspot effect

The effect is as follows: analyze 1. Here you can...

Design Story: The Security Guard Who Can't Remember License Plates

<br />In order to manage the vehicles enteri...

Analysis of the method of setting up scheduled tasks in mysql

This article uses an example to describe how to s...

XHTML Getting Started Tutorial: XHTML Hyperlinks

It is no exaggeration to say that hyperlinks conne...

Steps to modify the MySQL database data file path under Linux

After installing the MySQL database using the rpm...

Ubuntu 16.04 image complete installation tutorial under VMware

This article shares with you the installation tut...

How to smoothly go online after MySQL table partitioning

Table of contents Purpose of the table For exampl...