[环境搭建] 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



三、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

安装docker-compose

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

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




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

配置docker服务

vim /etc/systemd/system/docker.service
[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

运行docker systemctl

systemctl start docker

开机自动启动docker

systemctl enable docker

五、使用docker-compose运行onlyoffice

创建docker-compose.yml文件

vim docker-compose.yml

配置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:

使用docker-compose后台运行onlyoffice

docker-compose up -d

运行之后的效果

在这里插入图片描述

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
To set up ONLYOFFICE Workspace using Docker Compose, you can follow these steps: 1. Install Docker and Docker Compose on your machine if you haven't already done so. 2. Create a new directory for your ONLYOFFICE Workspace configuration files. 3. Inside the directory, create a `docker-compose.yml` file and open it in a text editor. 4. Add the following content to your `docker-compose.yml` file: ``` version: '3' services: onlyoffice: image: onlyoffice/workspace:latest ports: - 80:80 - 443:443 environment: - JWT_ENABLED=true - JWT_SECRET=YOUR_JWT_SECRET - LETSENCRYPT_HOST=your-domain.com - LETSENCRYPT_EMAIL=your-email@example.com volumes: - ./data:/var/www/onlyoffice/Data - ./logs:/var/log/onlyoffice - ./nginx:/etc/nginx/sites-available ``` Replace `YOUR_JWT_SECRET` with your own secret key. Also, update `your-domain.com` with your domain name and `your-email@example.com` with your email address. 5. Save the `docker-compose.yml` file. 6. Create the necessary directories for volumes by running the following commands in your terminal: ``` mkdir data mkdir logs mkdir nginx ``` 7. Start ONLYOFFICE Workspace by running the following command in the same directory as your `docker-compose.yml` file: ``` docker-compose up -d ``` 8. Wait for the containers to start up. You can check the status by running `docker-compose ps`. 9. Once the containers are up and running, you should be able to access ONLYOFFICE Workspace by visiting your domain name in a web browser. That's it! You now have ONLYOFFICE Workspace set up using Docker Compose. Remember to configure any necessary DNS settings for your domain to point to the server running Docker.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值