当前位置:   article > 正文

[环境搭建] onlyoffice环境搭建(docker-compose)_onlyoffice docker-compose

onlyoffice docker-compose

只介绍环境搭建 不介绍集成

一、环境要求

内核:Linux
操作系统:centos 或者 ubuntu
容器环境:docker
容器镜像:onlyoffice-documentserver




二、docker下载

Centos 下载 docker

https://download.docker.com/linux/centos/

Centos 7.3 docker yum

http://docker-release-blue-prod.s3-website-us-east-1.amazonaws.com/linux/centos/7/x86_64/stable/Packages/

Centos 静态包

http://docker-release-blue-prod.s3-website-us-east-1.amazonaws.com/linux/static/stable/x86_64/

所有系统下载地址

https://download.docker.com

Linux 下载地址

https://download.docker.com/linux

Docker 20.10下载

http://docker-release-blue-prod.s3-website-us-east-1.amazonaws.com/linux/centos/7/x86_64/stable/Packages/docker-ce-20.10.0-3.el7.x86_64.rpm

centos包安装
yum install docker-ce-20.10.0-3.el7.x86_64.rpm
  • 1



三、docker-compose下载与安装

Docker-compose

https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64

下载
curl -O https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64

  • 1
  • 2
安装docker-compose

将下载的docker-compose 移动到/usr/bin目录下

mv ./docker-compose-Linux-x86_64 /usr/bin/docker-compose

  • 1
  • 2



四、以systemctl服务方式后台运行docker

配置docker服务

vim /etc/systemd/system/docker.service
  • 1
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target
 
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

运行docker systemctl

systemctl start docker
  • 1

开机自动启动docker

systemctl enable docker
  • 1

五、使用docker-compose运行onlyoffice

创建docker-compose.yml文件

vim docker-compose.yml
  • 1

配置onlyoffice-documentserver onlyoffice-rabbitmq onlyoffice-postgresql

version: '2'
services:
  onlyoffice-documentserver:
    build:
      context: .
    container_name: onlyoffice-documentserver
    depends_on:
      - onlyoffice-postgresql
      - onlyoffice-rabbitmq
    environment:
      - DB_TYPE=postgres
      - DB_HOST=onlyoffice-postgresql
      - DB_PORT=5432
      - DB_NAME=onlyoffice
      - DB_USER=onlyoffice
      - AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
      # Uncomment strings below to enable the JSON Web Token validation.
      #- JWT_ENABLED=true
      #- JWT_SECRET=secret
      #- JWT_HEADER=Authorization
      #- JWT_IN_BODY=true
    ports:
      - '8088:80'
      - '443:443'
    stdin_open: true
    restart: always
    stop_grace_period: 60s
    volumes:
      - /var/www/onlyoffice/Data
      - /var/log/onlyoffice
      - /var/lib/onlyoffice/documentserver/App_Data/cache/files
      - /var/www/onlyoffice/documentserver-example/public/files
      - /usr/share/fonts

  onlyoffice-rabbitmq:
    container_name: onlyoffice-rabbitmq
    image: rabbitmq
    restart: always
    expose:
      - '5672'
    ports:
      - '5672:5672'

  onlyoffice-postgresql:
    container_name: onlyoffice-postgresql
    image: postgres:9.5
    environment:
      - POSTGRES_DB=onlyoffice
      - POSTGRES_USER=onlyoffice
      - POSTGRES_HOST_AUTH_METHOD=trust
    restart: always
    expose:
      - '5432'
    ports:
      - '5432:5432'
    volumes:
      - postgresql_data:/var/lib/postgresql

volumes:
  postgresql_data:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61

使用docker-compose后台运行onlyoffice

docker-compose up -d
  • 1

运行之后的效果

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/606850
推荐阅读
相关标签
  

闽ICP备14008679号