Unable to run NCP and OnlyOffice in Docker-Compose

I’m not able to run NCP and OnlyOffice as one docker-compose file and I don’t know how to do it.
Maybe somebody of you has experience with that combination or at least NextCloud and OnlyOffice.

First of all I tried it with this compose file:

version: '2'
services:
  nextcloudpi:
    image: ownyourbits/nextcloudpi-armhf
    command: "$${IP}"
    ports:
     - "80:80"
     - "443:443"
     - "4443:4443"
    restart: always
    volumes:
     - /media/storage/data:/data
     - /etc/localtime:/etc/localtime:ro
    container_name: nextcloudpi

  onlyoffice-documentserver-data:
    container_name: onlyoffice-documentserver-data
    image: onlyoffice/documentserver:latest
    environment:
      - ONLYOFFICE_DATA_CONTAINER=true
      - POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
      - POSTGRESQL_SERVER_PORT=5432
      - POSTGRESQL_SERVER_DB_NAME=onlyoffice
      - POSTGRESQL_SERVER_USER=onlyoffice
      - AMQP_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq
      - REDIS_SERVER_HOST=onlyoffice-redis
      - REDIS_SERVER_PORT=6379
      # Uncomment strings below to enable the JSON Web Token validation.
      #- JWT_ENABLED=true
      #- JWT_SECRET=secret
      #- JWT_HEADER=Authorization
    stdin_open: true
    restart: always
    networks:
      - onlyoffice
    volumes:
       - /etc/onlyoffice
       - /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-documentserver:
    image: onlyoffice/documentserver:latest
    depends_on:
      - onlyoffice-documentserver-data
      - onlyoffice-postgresql
      - onlyoffice-redis
      - onlyoffice-rabbitmq
    environment:
      - ONLYOFFICE_DATA_CONTAINER_HOST=onlyoffice-documentserver-data
      - BALANCE=uri depth 3
      - EXCLUDE_PORTS=443
      - HTTP_CHECK=GET /healthcheck
      - EXTRA_SETTINGS=http-check expect string true
      # Uncomment the string below to redirect HTTP request to HTTPS request.
      #- FORCE_SSL=true
    stdin_open: true
    restart: always
    networks:
      - onlyoffice
    expose:
      - '80'
    volumes_from:
     - onlyoffice-documentserver-data

  onlyoffice-haproxy:
    container_name: onlyoffice-haproxy
    image: dockercloud/haproxy:1.5.1
    depends_on:
      - onlyoffice-documentserver
    environment:
      - MODE=http
      # Uncomment the string below to specify the path of ssl certificates
      #- CERT_FOLDER=/certs/
    stdin_open: true
    links:
     - onlyoffice-documentserver
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      # Uncomment the string below to map a ssl certificate from host
      # to the proxy container
      #- /app/onlyoffice/DocumentServer/data/certs/onlyoffice.pem:/certs/cert1.pem
    restart: always
    networks:
     - onlyoffice
    ports:
      - '8080:80'
      - '4443:443'
      - '1936:1936'
       
  onlyoffice-redis:
    container_name: onlyoffice-redis
    image: redis
    restart: always
    networks:
     - onlyoffice
    expose:
      - '6379'

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

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

networks:
  onlyoffice:
    driver: 'bridge'

volumes:
  ncdata:
  postgresql_data:

The instructions of OnlyOffice can be found here: https://helpcenter.onlyoffice.com/de/server/docker/document/docker-compose.aspx

The compose file they provide: https://raw.githubusercontent.com/ONLYOFFICE/Docker-DocumentServer/master/docker-compose.yml

But I’m already confused because on the internet I see so many docker installations just with the documentServer and the rest is not needed. Why do I need it here?

There is no OnlyOffice armhf docker image.
Afaik you need an amd64

Recommended System Requirements for OnlyOffice DocumentServer
RAM: 4 GB or more
CPU: dual-core 2 GHz or higher
Swap: at least 2 GB
HDD: at least 2 GB of free space
Distribution: 64-bit Red Hat, CentOS or other compatible distributive with kernel version 3.8 or later, 64-bit Debian, Ubuntu or other compatible distributive with kernel version 3.8 or later
Docker: version 1.9.0 or later

For current install I used https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/README.md

Can’t be right. If you go through the forum you can see for example that this guy has installed it on his XU4 Onlyoffice and nextcloud on one raspberry pi3?. And that is an arm device too.

But anyway I have also never read that just amd64 is supported. The problem always seems to be that NCP is using Apache and OnlyOffice uses NGINX.

he compiled onlyoffice. and build his own image.

if you look at docker hub there is only an old image.

grafik

that doesn’t matter. it’s just a waste of disk space and ram because you have two webserver.

that is working on your raspi? you can see an onlyoffice container running?

I think you are german, right? But still I want to share the information with all other people. I don’t have a RaspberryPi3, I’m using a ODROID as well. Model N2.

And nope does not seem like it’s working. I don’t know… I want to have it, but it does not work…

your container restarts. normally that means that the entrypoint fails.
did you check the logs. docker logs <container-name>?

why to you run redis, rabbitmq and postgres in separete conatiner? it’s already included in onlyoffice. to separate this would imho only make sense in case you want to scale this on several server.

Don’t ask me why I do something. I did what is in the manual of OnlyOffice or in their provided compose file.

image

Seems to be what you meant with the arm architecture. But I’m really wondering how other people get it running.

they compiled onlyoffice. :wink:

i guess it’s this manual: https://helpcenter.onlyoffice.com/server/linux/document/compile-source-code.aspx + put it all in a docker image.

I think I’m not able to get this done. Especially because there will be the port problem again because 80 and 443 will be already used by NCP.

if you are using docker. no. you would put nextcloud and onlyoffice behind a router. it’s already in your docker-compose file. dockercloud/haproxy:1.5.1.

but still it needs some fine tuning. and that’s not beginners level. :wink:

Yep that’s the problem. I tell you my dream is to run NCP, OnlyOffice and PiHole. Or even the OCDownloader in NCP but yeah I’m a beginner. Sometimes I would rather pay someone for that purpose but I think that would be way too expensive :smiley:

And when you say it’s not beginner level I shouldn’t even try it then.

of course you should.

although i doubt that a raspi could handle that load. and would be frustrating to work two/four weeks to get onlyoffice running to find out it’s too slow.

yeah. it starts at 1000€/d. :wink: it would be easier/cheaper to buy a small intel based box.

if you want to do some performance tests: do you have access to a cloud provider? scaleway.com or hetzner.de? you can rent a server for just an hour or two and try if a 2 cpu / 2gb ram machine is alright for you and onlyoffice.

to get a test instance of nc & oo in ten minutes on that machine follow the readme:

Like I said I’m not using a Rasp. Using ODROID N2 and it runs very well. 4GB RAM at least. And for my setup with ODROID, RAID system and 2 big NAS-HDDs I already paid 400 Euro and don’t want to pay much more for any technical things.

ok. let’s try.

assuming you have docker installed on your odroid.

git clone https://github.com/ONLYOFFICE/Docker-DocumentServer.git
cd Docker-DocumentServer

edit the Dockerfile. you have change the installation of onlyoffice itself.

line 60 & 61 are obsolate. the echo "$REPO_URL ... line 63 can be removed as well.

instead you have to copy all (needed) steps from https://helpcenter.onlyoffice.com/server/linux/document/compile-source-code.aspx .

nginx, redis, rabbitmq and postgresql are already installed in the docker file. you don’t need to copy them.

thats the end of the onlyoffice installation.

the only thing needed below the line is - i guess - the installation of the database schema.

hope you got the points.

after docker build you should have a arm based onlyoffice-documentserver. or a lot of error messages. :wink:

then you need a new docker-compose file. the one from your original posting won’t work.

Sorry had no time to test it.
The first thing is that the cloned Git repo dockerfile is different from the mentioned one.

ARG COMPANY_NAME=onlyoffice
ARG PRODUCT_NAME=documentserver

ENV COMPANY_NAME=$COMPANY_NAME

I find this lines there. You say do all needed steps. What does that mean for you?

Beginning from " Now you need to build Document Server components: " or where?
Sorry I’m a bit lost.

cd core/Common/3dParty && ./make.sh

I can’t execute that command.

image

@Reiner_Nippes

i tried as well. you replace the end of the Dockerfile below line 68.

RUN apt-get -y update && \
    npm install -g npm && \
    npm install -g grunt-cli && \
    apt-get install -yq \
      wget \
      build-essential \
      libcurl4-gnutls-dev \
      libglib2.0-dev \
      libgdk-pixbuf2.0-dev \
      libgtkglext1-dev \
      libatk1.0-dev \
      libcairo2-dev \
      libxml2-dev \
      libxss-dev \
      libgconf2-dev \
      default-jre \
      qt5-qmake \
      qt5-default  \
      p7zip-full \
      git \
      subversion && \
    git clone --recursive https://github.com/ONLYOFFICE/DocumentServer.git && \
    cd /DocumentServer/core/Common/3dParty && /DocumentServer/core/Common/3dParty/make.sh && \
    cd /DocumentServer/core && /DocumentServer/core/make && \
    cd /DocumentServer/sdkjs && /DocumentServer/sdkjs/make && \
    cd /DocumentServer/server && /DocumentServer/server/make && \
    cd /DocumentServer && make /DocumentServer/install && \
    service postgresql start && \
    psql -hlocalhost -Uonlyoffice -d onlyoffice -f /var/www/onlyoffice/documentserver/server/schema/postgresql/createdb.sql && \
    service postgresql stop && \
    service supervisor stop && \
    chmod 755 /app/onlyoffice/*.sh && \
    rm -rf /var/log/onlyoffice && \
    rm -rf /var/lib/apt/lists/*

VOLUME /var/log/onlyoffice /var/lib/onlyoffice /var/www/onlyoffice/Data /var/lib/postgresql /usr/share/fonts/truetype/custom

ENTRYPOINT /app/onlyoffice/run-document-server.sh

done that you run docker build .

but the bad news is that it won’t compile. i’m afraid you have to ask here:

So I don’t even need to try it… that’s kinda sad. I really thought it’s easy to do it. Whatever then I give it up. Watching all the comments in this GitHub issue thread is meeeh…

I found a nice video and will maybe try it but it’s german so maybe problematic for other users.

He is hiring a server for not even 1 Euro per month and can use it just for OnlyOffice. Sounds nice in my opinion.

Hi,
I created an arm64 docker container with onlyoffice. I can confirm that it’s working and it’s really simmilar to the official amd64 one (I modified it to work on arm64). I’ve been using it for over 2 months without any issues so far. I’ve been also able to open over 100MB odp presentations without any issues. I’m running RPi4 4GB with an external HDD.

You can find everything you need here. You only have to have docker and docker-compose installed, everything else should be handled by the container. Building takes a long time, so make a cofee, chill a bit as docker does it’s thing.

Hope I helped.