Use case: integration with Nextcloud.
The easiest is to use docker-compose that will setup network, volumes and run containers as needed. You need to define a secret that will be used to validate JWT requests. This can be done by setting the variable in the .env file:
JWT_SECRET=change_me_for_a_strong_secret
After that, run:
docker-compose up -d
This should make docservice available in local port 8000 and spellchecker
available in local port 8080. You have then to manually setup a proxy to
serve tge services through SSL/TLS. Check upstream's
document-server-proxy
repository for more information on how to do that:
docker-compose.ymlUse this image with the following docker-compose.yml file:
---
version: '3'
services:
onlyoffice-documentserver:
container_name: onlyoffice-documentserver
image: infrarednetwork/onlyoffice-documentserver:${TAG}
env_file:
- .env
environment:
- RABBITMQ_SERVER_URL=amqp://guest:guest@onlyoffice-rabbitmq
- REDIS_SERVER_HOST=onlyoffice-redis
- REDIS_SERVER_PORT=6379
- POSTGRESQL_SERVER_HOST=onlyoffice-postgresql
- POSTGRESQL_SERVER_PORT=5432
- POSTGRESQL_SERVER_DB_NAME=onlyoffice
- POSTGRESQL_SERVER_USER=onlyoffice
- POSTGRESQL_SERVER_PASS=onlyoffice
restart: always
ports:
- '8000:8000'
- '8080:8080'
depends_on:
- onlyoffice-postgresql
- onlyoffice-redis
- onlyoffice-rabbitmq
volumes:
- onlyoffice-log:/var/log/onlyoffice
- onlyoffice-www-data:/var/www/onlyoffice/Data
- onlyoffice-lib:/var/lib/onlyoffice
- system-custom-fonts:/usr/share/fonts/truetype/custom
onlyoffice-redis:
container_name: onlyoffice-redis
image: redis:alpine
command: ["redis-server", "--appendonly", "yes"]
restart: always
expose:
- '6379'
volumes:
- redis-data:/data
onlyoffice-rabbitmq:
container_name: onlyoffice-rabbitmq
image: rabbitmq:alpine
restart: always
expose:
- '5672'
volumes:
- rabbitmq-home:/var/lib/rabbitmq
onlyoffice-postgresql:
container_name: onlyoffice-postgresql
image: postgres
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_PASSWORD=onlyoffice
restart: always
expose:
- '5432'
volumes:
- postgresql-data:/var/lib/postgresql/data
volumes:
onlyoffice-log:
onlyoffice-www-data:
onlyoffice-lib:
system-custom-fonts:
redis-data:
rabbitmq-home:
postgresql-data:
To add new fonts, just follow upstream documentation. The needed files will be generated when the container starts. This is not ideal because generation takes time, but is a workaround upstream implements to make it so people can add their fonts to the pre-built images.
If you don't need this feature, you can skip font generation by running the
container with SKIP_FONTS_GENERATION=true in the environment Just add it
to the .venv file in the root of the repository prior to starting containers
with docker-compose.
This image is currently being tested with Nextcloud, and these are some of the important gotchas found during usage:
Onlyoffice document server copies the document from Nextcloud, so while the document is open for editing it will differ from the version stored in Nextcloud (that is, is if someone tries to download from Nextcloud she will see a different version.
The document is only stored back in Nextcloud 10 seconds (this is configurable) after all editing sessions have finished. That means that while there's at least one open session (either active or idle) the versions will differ, and if either the document server or the connection between Nextcloud and document server break for some reason it is possible that there'll be data loss.
There is a setting for expiring idle sessions after a certain amount of time. This helps making sure the document will not hang indefinitelly in the document server if someone leaves a tab open. We are using 5 minutes, it's works nicelly.
You need to manually set a secret key that will be used by Nextcloud to sign requests to OnlyOffice Document Server. Without that, anyone can interact with the service. This is currently done by passing the variable JWT_SECRET to the document server container.
We needed to tweak some things from the default docker-compose.yml file config to enable persistence and avoid losing data in the case described above. Basically, we named the docker volumes to make sure it always uses the same ones and also passed a command line parameter to redis.
The binary package distributed by ONLYOFFICE is limited to 20 "connections". Here, we are compiling it from source and increasing that limit.
Docker expects that its PID 1 process will take care of reaping zombie processes, and if that doesn't happen unexpected behaviors might happen with the container. Because of that, we currently use a bash script as entrypoint and directly call supervisord inside that script. This is a bit different from what upstream does, as it uses init.d to start supervisord and hook the bash script with a tail -f to the application logs.
Content type
Image
Digest
Size
1.2 GB
Last updated
almost 6 years ago
docker pull infrarednetwork/onlyoffice-documentserver