From 21f5019e1c86930029702791ea6fe9cf2e3c7039 Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Wed, 9 Feb 2022 09:37:52 +0200 Subject: [PATCH 01/36] Initialliaze services.CoAuthoring.redis before attempting to set a child to a value (#404) Co-authored-by: papacarlo --- run-document-server.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/run-document-server.sh b/run-document-server.sh index 2bcdcc2..30a3f3b 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -284,6 +284,7 @@ update_rabbitmq_setting(){ } update_redis_settings(){ + ${JSON} -I -e "if(this.services.CoAuthoring.redis===undefined)this.services.CoAuthoring.redis={};" ${JSON} -I -e "this.services.CoAuthoring.redis.host = '${REDIS_SERVER_HOST}'" ${JSON} -I -e "this.services.CoAuthoring.redis.port = '${REDIS_SERVER_PORT}'" } -- 2.45.2 From 05aa933b9aeee278ac150b671dd07dc48fd4ae0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 16:45:56 +0100 Subject: [PATCH 02/36] Initial commit Docker build process now adds debian bullseye repositories, downloads needed arm dependencies, downloads qemu and binfmt, downloads and modifies needed amd64 libraries Change the install process of documentserver itself: Downloads package from official debian repositories, modifies dependencies, repackages it and resumes the normal install process. Package does not install from `/tmp` but from `/build` which is removed after instalation is completed `docker-compose.yml` larger stop grace period - Raspberry Pis have slow storage, set to two minutes just to be sure it doesn't get killed because of that --- Dockerfile | 57 ++++++++++++++++++++++++++++++++++++++-------- docker-compose.yml | 2 +- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d8b2c2..9870e8d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ -FROM ubuntu:20.04 -LABEL maintainer Ascensio System SIA +FROM debian:latest +LABEL maintainer="jiriks74" + +RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free\ndeb http://deb.debian.org/debian bullseye-updates main contrib non-free\ndeb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list + +RUN mkdir /build +RUN cd /build ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=12 @@ -31,7 +36,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ libxml2 \ libxss1 \ libxtst6 \ - mysql-client \ + mariadb-client \ nano \ net-tools \ netcat-openbsd \ @@ -62,7 +67,41 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ service rabbitmq-server stop && \ service supervisor stop && \ service nginx stop && \ - rm -rf /var/lib/apt/lists/* + +RUN apt install qemu binfmt-support qemu-user-static -t bullseye-backports -y + +RUN dpkg --add-architecture amd64 +RUN apt update && apt install libgcc-s1 libgcc-s1:amd64 -y + +RUN cd /build && apt download libc6:amd64 +RUN dpkg-deb -R /build/libc6*.deb /build/libc6 + +RUN sed -i 's/^Package: libc6$/Package: libc6-amd64/' /build/libc6/DEBIAN/control +RUN sed -i 's/^Depends: libgcc-s1, libcrypt1$/#Depends: libgcc-s1, libcrypt1/' /build/libc6/DEBIAN/control + +RUN rm -rf /build/libc6/usr/share/doc +RUN rm -rf /build/libc6/usr/share/lintian + +RUN dpkg-deb -b /build/libc6 /build/libc6-modified.deb +RUN dpkg -i /build/libc6-modified.deb + +RUN cd /build && apt download libstdc++6:amd64 +RUN dpkg-deb -R /build/libstdc++6*.deb /build/stdc + +RUN sed -i 's/^Depends: gcc-10-base (= 10.2.1-6), libc6 (>= 2.23), libgcc-s1 (>= 4.2)$/#Depends: gcc-10-base (= 10.2.1-6), libc6 (>= 2.23), libgcc-s1 (>= 4.2)/' /build/stdc/DEBIAN/control + +RUN dpkg-deb -b /build/stdc /build/libstdc++6-modified.deb +RUN dpkg -i /build/libstdc++6-modified.deb + +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 +RUN echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list + +RUN cd /build && apt update && apt download onlyoffice-documentserver:amd64 +RUN dpkg-deb -R /build/onlyoffice-documentserver*.deb /build/onlyoffice + +RUN sed -i 's/^Depends: debconf (>= 0.5) | debconf-2.0, adduser, ca-certificates, coreutils, curl, libasound2, libcairo2, libcurl3 | libcurl4, libcurl3-gnutls, libgconf-2-4, libgtk-3-0, libstdc++6 (>= 4.8.4), libxml2, libxss1, libxtst6, logrotate, mysql-client | mariadb-client, nginx-extras (>= 1.3.13), postgresql-client (>= 9.1), pwgen, supervisor (>= 3.0b2), xvfb, zlib1g$/Depends: debconf:arm64 (>= 0.5) | debconf-2.0:arm64, adduser:arm64, ca-certificates:arm64, coreutils:arm64, curl:arm64, libasound2:arm64, libcairo2:arm64, libcurl3:arm64 | libcurl4:arm64, libcurl3-gnutls:arm64, libgconf-2-4:arm64, libgtk-3-0:arm64, libstdc++6:amd64 (>= 4.8.4), libxml2:arm64, libxss1:arm64, libxtst6:arm64, logrotate:arm64, mysql-client:arm64 | mariadb-client:arm64, nginx-extras:arm64 (>= 1.3.13), postgresql-client:arm64 (>= 9.1), pwgen:arm64, supervisor:all (>= 3.0b2), xvfb:arm64, zlib1g:arm64/' /build/onlyoffice/DEBIAN/control + +RUN dpkg-deb -b /build/onlyoffice /build/onlyoffice-documentserver-modified.deb COPY config /app/ds/setup/config/ COPY run-document-server.sh /app/ds/run-document-server.sh @@ -75,15 +114,13 @@ ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${C ENV COMPANY_NAME=$COMPANY_NAME \ PRODUCT_NAME=$PRODUCT_NAME - -RUN wget -q -P /tmp "$PACKAGE_URL" && \ - apt-get -y update && \ - service postgresql start && \ - apt-get -yq install /tmp/$(basename "$PACKAGE_URL") && \ + +RUN service postgresql start && \ + apt-get -yq install /build/onlyoffice-documentserver-modified.deb && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/ds/*.sh && \ - rm -f /tmp/$(basename "$PACKAGE_URL") && \ + rm -rf /build/ && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yml b/docker-compose.yml index 51fafb2..c93b4b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: - '443:443' stdin_open: true restart: always - stop_grace_period: 60s + stop_grace_period: 120s volumes: - /var/www/onlyoffice/Data - /var/log/onlyoffice -- 2.45.2 From ba8a436cb45604f3ebea382dd62854a28062a1a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 16:55:45 +0100 Subject: [PATCH 03/36] Fix postgresql version, no line after \ --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9870e8d..120ec2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb h RUN mkdir /build RUN cd /build -ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=12 +ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=13 ARG ONLYOFFICE_VALUE=onlyoffice @@ -66,7 +66,7 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ service redis-server stop && \ service rabbitmq-server stop && \ service supervisor stop && \ - service nginx stop && \ + service nginx stop RUN apt install qemu binfmt-support qemu-user-static -t bullseye-backports -y -- 2.45.2 From a1aa8b21e24a51d4dc962d51cb8874f4a4b66b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 19:01:03 +0100 Subject: [PATCH 04/36] Remove unnecessary files To clarify, unnecessary for this usecase. To find all files with the modifications in `Dockerfile` for `arm64` look into the [arm64-full_repo](https://github.com/jiriks74/Docker-DocumentServer-Arm64/tree/arm64-full_repo) --- Makefile | 69 -------------------- cluster.yml | 108 -------------------------------- tests/activemq.yml | 32 ---------- tests/certs-customized.yml | 18 ------ tests/certs.yml | 13 ---- tests/graphite.yml | 32 ---------- tests/graphite/statsd/config.js | 7 --- tests/mariadb.yml | 36 ----------- tests/mysql.yml | 37 ----------- tests/postgres-old.yml | 34 ---------- tests/postgres.yml | 35 ----------- tests/rabbitmq-old.yml | 29 --------- tests/rabbitmq.yml | 29 --------- tests/redis.yml | 31 --------- tests/standalone.yml | 12 ---- tests/test.sh | 54 ---------------- 16 files changed, 576 deletions(-) delete mode 100644 Makefile delete mode 100644 cluster.yml delete mode 100644 tests/activemq.yml delete mode 100644 tests/certs-customized.yml delete mode 100644 tests/certs.yml delete mode 100644 tests/graphite.yml delete mode 100644 tests/graphite/statsd/config.js delete mode 100644 tests/mariadb.yml delete mode 100644 tests/mysql.yml delete mode 100644 tests/postgres-old.yml delete mode 100644 tests/postgres.yml delete mode 100644 tests/rabbitmq-old.yml delete mode 100644 tests/rabbitmq.yml delete mode 100644 tests/redis.yml delete mode 100644 tests/standalone.yml delete mode 100755 tests/test.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index f840a15..0000000 --- a/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -COMPANY_NAME ?= ONLYOFFICE -GIT_BRANCH ?= develop -PRODUCT_NAME ?= DocumentServer -PRODUCT_VERSION ?= 0.0.0 -BUILD_NUMBER ?= 0 -ONLYOFFICE_VALUE ?= onlyoffice -S3_BUCKET ?= repo-doc-onlyoffice-com -RELEASE_BRANCH ?= unstable - -COMPANY_NAME_LOW = $(shell echo $(COMPANY_NAME) | tr A-Z a-z) -PRODUCT_NAME_LOW = $(shell echo $(PRODUCT_NAME) | tr A-Z a-z) -COMPANY_NAME_LOW_ESCAPED = $(subst -,,$(COMPANY_NAME_LOW)) - -PACKAGE_NAME := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW) -PACKAGE_VERSION := $(PRODUCT_VERSION)-$(BUILD_NUMBER) -PACKAGE_URL := http://$(S3_BUCKET).s3.amazonaws.com/$(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/ubuntu/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_amd64.deb - -ifeq ($(RELEASE_BRANCH),$(filter $(RELEASE_BRANCH),unstable testing)) - DOCKER_TAG := $(subst -,.,$(PACKAGE_VERSION)) -else - DOCKER_TAG := $(subst -,.,$(PACKAGE_VERSION))-$(subst /,-,$(GIT_BRANCH)) -endif - -DOCKER_IMAGE := $(subst -,,$(COMPANY_NAME_LOW))/4testing-$(PRODUCT_NAME_LOW) -DOCKER_DUMMY := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)__$(DOCKER_TAG).dummy -DOCKER_ARCH := $(COMPANY_NAME_LOW)-$(PRODUCT_NAME_LOW)_$(PACKAGE_VERSION).tar.gz -DOCKER_ARCH_URI := $(COMPANY_NAME_LOW)/$(RELEASE_BRANCH)/docker/$(notdir $(DOCKER_ARCH)) - -.PHONY: all clean clean-docker image deploy docker publish - -$(DOCKER_DUMMY): - docker pull ubuntu:20.04 - docker build \ - --build-arg PACKAGE_URL=$(PACKAGE_URL) \ - --build-arg COMPANY_NAME=$(COMPANY_NAME_LOW) \ - --build-arg PRODUCT_NAME=$(PRODUCT_NAME_LOW) \ - --build-arg ONLYOFFICE_VALUE=$(ONLYOFFICE_VALUE) \ - -t $(DOCKER_IMAGE):$(DOCKER_TAG) . && \ - mkdir -p $$(dirname $@) && \ - echo "Done" > $@ - -$(DOCKER_ARCH): $(DOCKER_DUMMY) - docker save $(DOCKER_IMAGE):$(DOCKER_TAG) | \ - gzip > $@ - -all: image - -clean: - rm -rfv *.dummy *.tar.gz - -clean-docker: - docker rmi -f $$(docker images -q $(COMPANY_NAME_LOW)/*) || exit 0 - -image: $(DOCKER_DUMMY) - -deploy: $(DOCKER_DUMMY) - for i in {1..3}; do \ - docker push $(DOCKER_IMAGE):$(DOCKER_TAG) && break || sleep 1m; \ - done -ifeq ($(RELEASE_BRANCH),unstable) - docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest - for i in {1..3}; do \ - docker push $(DOCKER_IMAGE):latest && break || sleep 1m; \ - done -endif - -publish: $(DOCKER_ARCH) - aws s3 cp --no-progress --acl public-read \ - $(DOCKER_ARCH) s3://$(S3_BUCKET)/$(DOCKER_ARCH_URI) diff --git a/cluster.yml b/cluster.yml deleted file mode 100644 index 0cb07c1..0000000 --- a/cluster.yml +++ /dev/null @@ -1,108 +0,0 @@ -version: '2.1' - -x-ds-image: - &ds-image - ${COMPANY_NAME:-onlyoffice}/${PRODUCT_NAME:-documentserver-de}:${PRODUCT_VERSION:-latest} - -services: - onlyoffice-documentserver-data: - container_name: onlyoffice-documentserver-data - image: *ds-image - environment: - - ONLYOFFICE_DATA_CONTAINER=true - - DB_HOST=onlyoffice-postgresql - - DB_PORT=5432 - - DB_NAME=onlyoffice - - DB_USER=onlyoffice - - AMQP_URI=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 - #- JWT_IN_BODY=true - stdin_open: true - restart: always - 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: *ds-image - 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 - 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 - ports: - - '80:80' - - '443:443' - - '1936:1936' - - onlyoffice-redis: - container_name: onlyoffice-redis - image: redis - restart: always - expose: - - '6379' - - onlyoffice-rabbitmq: - container_name: onlyoffice-rabbitmq - image: rabbitmq - restart: always - expose: - - '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' - volumes: - - postgresql_data:/var/lib/postgresql - -volumes: - postgresql_data: diff --git a/tests/activemq.yml b/tests/activemq.yml deleted file mode 100644 index 5781c64..0000000 --- a/tests/activemq.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - environment: - - AMQP_TYPE=${AMQP_TYPE:-activemq} - - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-activemq} - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - networks: - - onlyoffice - - onlyoffice-activemq: - container_name: onlyoffice-activemq - image: webcenter/activemq:${ACTIVEMQ_VERSION:-5.14.3} - environment: - - ACTIVEMQ_USERS_guest=${ACTIVEMQ_USERS_guest:-guest} - - ACTIVEMQ_GROUPS_owners=${ACTIVEMQ_GROUPS_owners:-guest} - restart: always - networks: - - onlyoffice - expose: - - '5672' - -networks: - onlyoffice: - driver: 'bridge' diff --git a/tests/certs-customized.yml b/tests/certs-customized.yml deleted file mode 100644 index af73081..0000000 --- a/tests/certs-customized.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - environment: - - SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-/var/www/onlyoffice/Data/certs/tls.crt} - - SSL_KEY_PATH=${SSL_KEY_PATH:-/var/www/onlyoffice/Data/certs/tls.key} - - CA_CERTIFICATES_PATH=${CA_CERTIFICATES_PATH:-/var/www/onlyoffice/Data/certs/ca-certificates.pem} - - SSL_DHPARAM_PATH=${SSL_DHPARAM_PATH:-/var/www/onlyoffice/Data/certs/dhparam.pem} - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - volumes: - - ./data:/var/www/onlyoffice/Data diff --git a/tests/certs.yml b/tests/certs.yml deleted file mode 100644 index 77d37ce..0000000 --- a/tests/certs.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - volumes: - - ./data:/var/www/onlyoffice/Data diff --git a/tests/graphite.yml b/tests/graphite.yml deleted file mode 100644 index 2bc4694..0000000 --- a/tests/graphite.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - depends_on: - - onlyoffice-graphite - environment: - - METRICS_ENABLED=${METRICS_ENABLED:-true} - - METRICS_HOST=${METRICS_HOST:-localhost} - - METRICS_PORT=${METRICS_PORT:-8125} - - METRICS_PREFIX=${METRICS_PREFIX:-ds.} - stdin_open: true - restart: always - expose: - - '2003' - ports: - - '80:80' - volumes: - - ./graphite/statsd:/var/www/onlyoffice/documentserver/server/Metrics/config - - onlyoffice-graphite: - container_name: onlyoffice-graphite - image: graphiteapp/graphite-statsd - environment: - - GRAPHITE_STATSD_HOST=${GRAPHITE_STATSD_HOST:-onlyoffice-documentserver} - - GRAPHITE_TIME_ZONE=${GRAPHITE_TIME_ZONE:-Etc/UTC} - ports: - - '8888:80' - stdin_open: true - restart: always diff --git a/tests/graphite/statsd/config.js b/tests/graphite/statsd/config.js deleted file mode 100644 index 2ebffe6..0000000 --- a/tests/graphite/statsd/config.js +++ /dev/null @@ -1,7 +0,0 @@ -{ - "graphiteHost": "onlyoffice-graphite", - "graphitePort": 2003, - "port": 8125, - "flushInterval": 60000, - "backends": [ "./backends/graphite.js" ] -} diff --git a/tests/mariadb.yml b/tests/mariadb.yml deleted file mode 100644 index 4bb8de5..0000000 --- a/tests/mariadb.yml +++ /dev/null @@ -1,36 +0,0 @@ -version: '2.1' -services: - ds: - container_name: ds - build: - context: ../. - depends_on: - - onlyoffice-mariadb - environment: - - DB_TYPE=${DB_TYPE:-mysql} - - DB_HOST=${DB_HOST:-onlyoffice-mariadb} - - DB_PORT=${DB_PORT:-3306} - - DB_NAME=${DB_NAME:-onlyoffice} - - DB_USER=${DB_USER:-onlyoffice} - - DB_PWD=${DB_PWD:-onlyoffice} - stdin_open: true - restart: always - ports: - - '80:80' - - onlyoffice-mariadb: - container_name: onlyoffice-mariadb - image: mariadb:${MARIADB_VERSION:-10.5} - environment: - - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} - - MYSQL_USER=${MYSQL_USER:-onlyoffice} - - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} - - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} - restart: always - volumes: - - mysql_data:/var/lib/mysql - expose: - - '3306' - -volumes: - mysql_data: diff --git a/tests/mysql.yml b/tests/mysql.yml deleted file mode 100644 index 20fcd70..0000000 --- a/tests/mysql.yml +++ /dev/null @@ -1,37 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - depends_on: - - onlyoffice-mysql - environment: - - DB_TYPE=${DB_TYPE:-mysql} - - DB_HOST=${DB_HOST:-onlyoffice-mysql} - - DB_PORT=${DB_PORT:-3306} - - DB_NAME=${DB_NAME:-onlyoffice} - - DB_USER=${DB_USER:-onlyoffice} - - DB_PWD=${DB_PWD:-onlyoffice} - stdin_open: true - restart: always - ports: - - '80:80' - - onlyoffice-mysql: - container_name: onlyoffice-mysql - image: mysql:${MYSQL_VERSION:-5.7} - command: --default-authentication-plugin=mysql_native_password - environment: - - MYSQL_DATABASE=${MYSQL_DATABASE:-onlyoffice} - - MYSQL_USER=${MYSQL_USER:-onlyoffice} - - MYSQL_PASSWORD=${MYSQL_PASSWORD:-onlyoffice} - - MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD:-yes} - restart: always - volumes: - - mysql_data:/var/lib/mysql - expose: - - '3306' - -volumes: - mysql_data: diff --git a/tests/postgres-old.yml b/tests/postgres-old.yml deleted file mode 100644 index 237246c..0000000 --- a/tests/postgres-old.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - depends_on: - - onlyoffice-postgresql - environment: - - POSTGRESQL_SERVER_HOST=${DB_HOST:-onlyoffice-postgresql} - - POSTGRESQL_SERVER_PORT=${DB_PORT:-5432} - - POSTGRESQL_SERVER_DB_NAME=${DB_NAME:-onlyoffice} - - POSTGRESQL_SERVER_USER=${DB_USER:-onlyoffice} - - POSTGRESQL_SERVER_PASS=${DB_PWD:-onlyoffice} - stdin_open: true - restart: always - ports: - - '80:80' - - onlyoffice-postgresql: - container_name: onlyoffice-postgresql - image: postgres:9.5 - environment: - - POSTGRES_DB=${POSTGRES_DB:-onlyoffice} - - POSTGRES_USER=${POSTGRES_USER:-onlyoffice} - - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust} - restart: always - expose: - - '5432' - volumes: - - postgresql_data:/var/lib/postgresql - -volumes: - postgresql_data: diff --git a/tests/postgres.yml b/tests/postgres.yml deleted file mode 100644 index 8333b10..0000000 --- a/tests/postgres.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - depends_on: - - onlyoffice-postgresql - environment: - - DB_TYPE=${DB_TYPE:-postgres} - - DB_HOST=${DB_HOST:-onlyoffice-postgresql} - - DB_PORT=${DB_PORT:-5432} - - DB_NAME=${DB_NAME:-onlyoffice} - - DB_USER=${DB_USER:-onlyoffice} - - DB_PWD=${DB_PWD:-onlyoffice} - stdin_open: true - restart: always - ports: - - '80:80' - - onlyoffice-postgresql: - container_name: onlyoffice-postgresql - image: postgres:${POSTGRES_VERSION:-9.5} - environment: - - POSTGRES_DB=${POSTGRES_DB:-onlyoffice} - - POSTGRES_USER=${POSTGRES_USER:-onlyoffice} - - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust} - restart: always - expose: - - '5432' - volumes: - - postgresql_data:/var/lib/postgresql - -volumes: - postgresql_data: diff --git a/tests/rabbitmq-old.yml b/tests/rabbitmq-old.yml deleted file mode 100644 index ce18691..0000000 --- a/tests/rabbitmq-old.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - environment: - - AMQP_SERVER_TYPE=${AMQP_SERVER_TYPE:-rabbitmq} - - AMQP_SERVER_URL=${AMQP_SERVER_URL:-amqp://guest:guest@onlyoffice-rabbitmq} - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - networks: - - onlyoffice - - onlyoffice-rabbitmq: - container_name: onlyoffice-rabbitmq - image: rabbitmq - restart: always - networks: - - onlyoffice - expose: - - '5672' - -networks: - onlyoffice: - driver: 'bridge' diff --git a/tests/rabbitmq.yml b/tests/rabbitmq.yml deleted file mode 100644 index 293045c..0000000 --- a/tests/rabbitmq.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - environment: - - AMQP_TYPE=${AMQP_TYPE:-rabbitmq} - - AMQP_URI=${AMQP_URI:-amqp://guest:guest@onlyoffice-rabbitmq} - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - networks: - - onlyoffice - - onlyoffice-rabbitmq: - container_name: onlyoffice-rabbitmq - image: rabbitmq:${RABBITMQ_VERSION:-latest} - restart: always - networks: - - onlyoffice - expose: - - '5672' - -networks: - onlyoffice: - driver: 'bridge' diff --git a/tests/redis.yml b/tests/redis.yml deleted file mode 100644 index 849be16..0000000 --- a/tests/redis.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - args: - - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} - environment: - - REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-onlyoffice-redis} - - REDIS_SERVER_PORT=${REDIS_SERVER_PORT:-6379} - stdin_open: true - restart: always - ports: - - '80:80' - - '443:443' - networks: - - onlyoffice - - onlyoffice-redis: - container_name: onlyoffice-redis - image: redis:${REDIS_VERSION:-latest} - restart: always - networks: - - onlyoffice - expose: - - '6379' - -networks: - onlyoffice: - driver: 'bridge' diff --git a/tests/standalone.yml b/tests/standalone.yml deleted file mode 100644 index f3de32f..0000000 --- a/tests/standalone.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '2.1' -services: - onlyoffice-documentserver: - container_name: onlyoffice-documentserver - build: - context: ../. - args: - - PRODUCT_NAME=${PRODUCT_NAME:-documentserver} - stdin_open: true - restart: always - ports: - - '80:80' diff --git a/tests/test.sh b/tests/test.sh deleted file mode 100755 index 535003a..0000000 --- a/tests/test.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -ssl=${ssl:-false} -private_key=${private_key:-tls.key} -certificate_request=${certificate_request:-tls.csr} -certificate=${certificate:-tls.crt} - -# Generate certificate -if [[ $ssl == "true" ]]; then - url=${url:-"https://localhost"} - - mkdir -p data/certs - pushd data/certs - - openssl genrsa -out ${private_key} 2048 - openssl req \ - -new \ - -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \ - -key ${private_key} \ - -out ${certificate_request} - openssl x509 -req -days 365 -in ${certificate_request} -signkey ${private_key} -out ${certificate} - openssl dhparam -out dhparam.pem 2048 - chmod 400 ${private_key} - - popd -else - url=${url:-"http://localhost"} -fi - -# Check if the yml exists -if [[ ! -f $config ]]; then - echo "File $config doesn't exist!" - exit 1 -fi - -# Run test environment -docker-compose -p ds -f $config up -d - -wakeup_timeout=90 - -# Get documentserver healthcheck status -echo "Wait for service wake up" -sleep $wakeup_timeout -healthcheck_res=$(wget --no-check-certificate -qO - ${url}/healthcheck) - -# Fail if it isn't true -if [[ $healthcheck_res == "true" ]]; then - echo "Healthcheck passed." -else - echo "Healthcheck failed!" - exit 1 -fi - -docker-compose -p ds -f $config down -- 2.45.2 From 2a34984f86881de806de4db13f05f633e0af6df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 19:47:15 +0100 Subject: [PATCH 05/36] Update README.md --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 18fb96e..1439e3c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,44 @@ +# FOR ARM64 ONLY +--- +## Onlyoffice-Documentserver with `arm64` support +### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` +### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) + +## Installation +#### 1. Clone the repository (for example to your home directory `cd /home/$USER/`) + + `git clone https://github.com/jiriks74/Docker-DocumentServer-Arm64.git && cd Docker-DocumentServer-Arm64` + +#### 2. Build the docker image + `docker-compose build` + - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow + +#### 3. Create and start the container + `docker-compose up -d --build` + - This will start the server. It is set to be automatically started/restarted so as long you have docker running on startup this will start automatically + +## Updating +#### 1. Stop and delete the old container + + `docker-compose down` + +#### 2. (optional) Clear the docker cache +#### - ! This will remove all unused cache images ! (good for saving space, bad if you develop with and need cache, but you understand it at that point) + + `docker rmi $(docker images -f "dangling=true" -q)` + +#### 4. Rebuild the image without cache + + `docker-compose build --no-cache` + +#### 3. Create and start the new container + + `docker-compose up -d` + +--- + +## The rest of this file is the official `README.md`. I will not change anything in it, it may not work. If you care about something, make a pull request and we'll figure it out. + * [Overview](#overview) * [Functionality](#functionality) * [Recommended System Requirements](#recommended-system-requirements) -- 2.45.2 From 00a3164f4abbe890a1aaed223e7014c28a87fec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 19:48:13 +0100 Subject: [PATCH 06/36] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 1439e3c..b19641b 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ ## The rest of this file is the official `README.md`. I will not change anything in it, it may not work. If you care about something, make a pull request and we'll figure it out. +
+ + * [Overview](#overview) * [Functionality](#functionality) * [Recommended System Requirements](#recommended-system-requirements) @@ -378,3 +381,6 @@ If you have any problems with or questions about this image, please visit our of [1]: https://forum.onlyoffice.com [2]: https://stackoverflow.com/questions/tagged/onlyoffice + + +
-- 2.45.2 From 2514966acd34eb10790b2f58eb0b7ae49855c0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 19:48:28 +0100 Subject: [PATCH 07/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b19641b..fba0d69 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # FOR ARM64 ONLY ---- + ## Onlyoffice-Documentserver with `arm64` support ### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` ### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) -- 2.45.2 From cee6f7b507e89885c8d08df2ae611aa9da724f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 19:50:04 +0100 Subject: [PATCH 08/36] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index fba0d69..47c0a30 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # FOR ARM64 ONLY ## Onlyoffice-Documentserver with `arm64` support + ### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` +### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well + ### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) ## Installation -- 2.45.2 From e50679fd0d7794495770db111985aa816da23b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Wed, 9 Mar 2022 20:17:41 +0100 Subject: [PATCH 09/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 47c0a30..06b6553 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ #### 2. Build the docker image `docker-compose build` - - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow + - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow (SSD will probably help, I'm running only on HDD) #### 3. Create and start the container `docker-compose up -d --build` -- 2.45.2 From 58334f6ab9ab29728449cdb4e7d1e3d879f5327b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 10 Mar 2022 00:05:11 +0100 Subject: [PATCH 10/36] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 06b6553..44fb4ac 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,22 @@ `docker-compose up -d` +## Setup `Secret key`with Nextcloud +1. Uncomment four lines starting with `JWT` in `docker-compose` +2. Set your secret on line `JWT_SECRET=yourSecret` +3. Open Nexcloud's `config.php` (by defauld `/var/www/nextcloud/config/config.php`) +4. Add this to the 2nd last line (before the line with `);`) and paste in your secret (3rd last line) +```php + 'onlyoffice' => + array ( + "jwt_secret" => "yourSecret", + "jwt_header" => "AuthorizationJwt" + ) +``` +5. Go to your Nextcloud settings, navigate to Onlyoffice settings +6. Add your server Address and Secret key +7. Save + --- ## The rest of this file is the official `README.md`. I will not change anything in it, it may not work. If you care about something, make a pull request and we'll figure it out. -- 2.45.2 From 6f4eb40f9148c5321644dc54e5de1bc7341aee03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 10 Mar 2022 00:05:54 +0100 Subject: [PATCH 11/36] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index c93b4b7..91863c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,7 +17,7 @@ services: # Uncomment strings below to enable the JSON Web Token validation. #- JWT_ENABLED=true #- JWT_SECRET=secret - #- JWT_HEADER=Authorization + #- JWT_HEADER=AuthorizationJwt #- JWT_IN_BODY=true ports: - '80:80' -- 2.45.2 From 610d7b8e45cb37904b62ce45baf430b4060b6056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 10 Mar 2022 00:06:31 +0100 Subject: [PATCH 12/36] Delete .travis.yml --- .travis.yml | 131 ---------------------------------------------------- 1 file changed, 131 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 084cddc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,131 +0,0 @@ -language: generic - -dist: trusty - -env: - # community edition - - config: standalone.yml - - # integration edition - - config: standalone.yml - PRODUCT_NAME: documentserver-ie - - - # certificates (default tls if onlyoffice not exists) - - config: certs.yml - ssl: true - - # certificates (default onlyoffice if exists) - - config: certs.yml - ssl: true - private_key: onlyoffice.key - certificate_request: onlyoffice.csr - certificate: onlyoffice.crt - - # custom certificates - - config: certs-customized.yml - ssl: true - private_key: mycert.key - certificate_request: mycert.csr - certificate: mycert.crt - SSL_CERTIFICATE_PATH: /var/www/onlyoffice/Data/certs/mycert.crt - SSL_KEY_PATH: /var/www/onlyoffice/Data/certs/mycert.key - - - # postgresql 12 - - config: postgres.yml - POSTGRES_VERSION: 12 - - # postgresql 11 - - config: postgres.yml - POSTGRES_VERSION: 11 - - # postgresql 10 - - config: postgres.yml - POSTGRES_VERSION: 10 - - # postgresql 9 - - config: postgres.yml - POSTGRES_VERSION: 9 - - # postgresql 9.5 - - config: postgres.yml - - # postgresql custom values - - config: postgres.yml - DB_NAME: mydb - DB_USER: myuser - DB_PWD: password - POSTGRES_DB: mydb - POSTGRES_USER: myuser - - # postgresql deprecated variables - - config: postgres-old.yml - - - # mysql 8 - - config: mysql.yml - MYSQL_VERSION: 8 - - # mysql 5 - - config: mysql.yml - MYSQL_VERSION: 5 - - # mysql 5.7 - - config: mysql.yml - - - # mariadb 10 - - config: mariadb.yml - MARIADB_VERSION: 10 - - # mariadb 10.5 - - config: mariadb.yml - - - - config: activemq.yml - ACTIVEMQ_VERSION: latest - - # activemq 5.14.3 - - config: activemq.yml - - - # rabbitmq latest - - config: rabbitmq.yml - - # rabbitmq 3 - - config: rabbitmq.yml - RABBITMQ_VERSION: 3 - - # rabbitmq old variables - - config: rabbitmq-old.yml - - - # redis latest with community edition - - config: redis.yml - - # redis latest with integraion edition - - config: redis.yml - PRODUCT_NAME: documentserver-ie - - # redis 6 - - config: redis.yml - REDIS_VERSION: 6 - - # redis 5 - - config: redis.yml - REDIS_VERSION: 5 - - - # graphite - - config: graphite.yml - -services: - - docker - -script: - # Go to tests dir - - cd ${PWD}/tests - - # Run test. - - ./test.sh -- 2.45.2 From 56011315db18f012f01e2735647613bb707dc2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 11 Mar 2022 09:55:35 +0100 Subject: [PATCH 13/36] Update README.md Remove `--build` from the 3rd step. It shouldn't be there as we already built the image with `docker-compose build` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44fb4ac..565fcc9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow (SSD will probably help, I'm running only on HDD) #### 3. Create and start the container - `docker-compose up -d --build` + `docker-compose up -d` - This will start the server. It is set to be automatically started/restarted so as long you have docker running on startup this will start automatically ## Updating -- 2.45.2 From 01c3c74b9a2d0e376fe76a41651002ac5de5d69a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Sun, 13 Mar 2022 23:57:50 +0100 Subject: [PATCH 14/36] Move copy command to the end of the file Reason: faster builds when editing scripts --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 120ec2a..dc4e455 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,9 +103,6 @@ RUN sed -i 's/^Depends: debconf (>= 0.5) | debconf-2.0, adduser, ca-certificates RUN dpkg-deb -b /build/onlyoffice /build/onlyoffice-documentserver-modified.deb -COPY config /app/ds/setup/config/ -COPY run-document-server.sh /app/ds/run-document-server.sh - EXPOSE 80 443 ARG COMPANY_NAME=onlyoffice @@ -119,11 +116,15 @@ RUN service postgresql start && \ apt-get -yq install /build/onlyoffice-documentserver-modified.deb && \ service postgresql stop && \ service supervisor stop && \ - chmod 755 /app/ds/*.sh && \ rm -rf /build/ && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* +COPY config /app/ds/setup/config/ +COPY run-document-server.sh /app/ds/run-document-server.sh + +RUN chmod 755 /app/ds/*.sh + VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom ENTRYPOINT ["/app/ds/run-document-server.sh"] -- 2.45.2 From a3813d64dc2e77632ae7229ecd0f6c1cf41cfc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 4 Apr 2022 18:32:43 +0200 Subject: [PATCH 15/36] Update README.md --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 565fcc9..1734802 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,18 @@ ### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) ## Installation -#### 1. Clone the repository (for example to your home directory `cd /home/$USER/`) +#### 1. Install `qemu`, `qemu-user`, `qemu-user-static` and `binfmt-support` (RPiOS packages) + `sudo apt install qemu-user qemu-user-static qemu binfmt-support` + +#### 2. Clone the repository (for example to your home directory `cd /home/$USER/`) `git clone https://github.com/jiriks74/Docker-DocumentServer-Arm64.git && cd Docker-DocumentServer-Arm64` -#### 2. Build the docker image +#### 3. Build the docker image `docker-compose build` - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow (SSD will probably help, I'm running only on HDD) -#### 3. Create and start the container +#### 4. Create and start the container `docker-compose up -d` - This will start the server. It is set to be automatically started/restarted so as long you have docker running on startup this will start automatically -- 2.45.2 From a4176e1dd6f04b6d9b7ed88929f2d2c4926921fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 4 Apr 2022 18:38:04 +0200 Subject: [PATCH 16/36] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1734802..83bb2b8 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,10 @@ ### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) ## Installation -#### 1. Install `qemu`, `qemu-user`, `qemu-user-static` and `binfmt-support` (RPiOS packages) - `sudo apt install qemu-user qemu-user-static qemu binfmt-support` + +#### 1. Install `qemu-user`, `qemu-user-static`, `qemu` and `binfmt-support` + + `sudo apt update && sudo apt install qemu-user qemu-user-static qemu binfmt-support` #### 2. Clone the repository (for example to your home directory `cd /home/$USER/`) -- 2.45.2 From 101ac458f52f87b6bfe5b223f2d18ea769ca7ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 4 Apr 2022 23:13:52 +0200 Subject: [PATCH 17/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83bb2b8..b8e8ba9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ #### 4. Rebuild the image without cache - `docker-compose build --no-cache` + `docker-compose build` #### 3. Create and start the new container -- 2.45.2 From 037eaea85b63da083aef50dd474cf9f67f367e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Mon, 4 Apr 2022 23:56:47 +0200 Subject: [PATCH 18/36] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b8e8ba9..b0bd984 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ ## Installation +### I recommend using prebuilt image that is available on [Docker Hub](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) as building it yourself does take really long time (more than half an hour). The instrucions on how to set it up using the prebuilt image are available there. If you still want to build the image yourself, the instructions are below. + #### 1. Install `qemu-user`, `qemu-user-static`, `qemu` and `binfmt-support` `sudo apt update && sudo apt install qemu-user qemu-user-static qemu binfmt-support` -- 2.45.2 From 10f303bc638a7db09f901b90285aaf0e104e1afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 5 Apr 2022 09:10:04 +0200 Subject: [PATCH 19/36] Add pretty things --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b0bd984..d54d407 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,12 @@ ## Onlyoffice-Documentserver with `arm64` support +[![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) +[![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) + +[![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer-Arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) + + ### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` ### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well -- 2.45.2 From bc9d3c9575e8017775d84c089b098664198b8e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 5 Apr 2022 09:21:32 +0200 Subject: [PATCH 20/36] Update README.md --- README.md | 113 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 90 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index d54d407..7ee5c12 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,97 @@ [![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer-Arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) -### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` -### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well +#### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` +#### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well -### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) +#### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) -## Installation +## Requirements +- You have to have `qemu`, `qemu-user`, `qemu-user-static` and `binftm-support` installed on your `arm64` host. + - On Raspberry Pi OS you can do `sudo apt install qemu qemu-user qemu-user-static binfmt-support` -### I recommend using prebuilt image that is available on [Docker Hub](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) as building it yourself does take really long time (more than half an hour). The instrucions on how to set it up using the prebuilt image are available there. If you still want to build the image yourself, the instructions are below. +## Usage +### docker-compose with prebuilt image (recommended) +```docker-compose +version: '2' +services: + onlyoffice-documentserver: + image: jiriks74/onlyoffice-documentserver-arm64:latest + 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=your_secret_key + #- JWT_HEADER=AuthorizationJwt + #- JWT_IN_BODY=true + ports: + - '88:80' + - '443:443' + stdin_open: true + restart: always + stop_grace_period: 120s + 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' + + 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' + volumes: + - postgresql_data:/var/lib/postgresql + +volumes: + postgresql_data: +``` + +### Setup `Secret key`with Nextcloud +1. Uncomment four lines starting with `JWT` in `docker-compose` +2. Set your secret on line `JWT_SECRET=yourSecret` +3. Open Nexcloud's `config.php` (by defauld `/var/www/nextcloud/config/config.php`) +4. Add this to the 2nd last line (before the line with `);`) and paste in your secret (3rd last line) +```php + 'onlyoffice' => + array ( + "jwt_secret" => "yourSecret", + "jwt_header" => "AuthorizationJwt" + ) +``` +5. Go to your Nextcloud settings, navigate to Onlyoffice settings +6. Add your server Address and Secret key +7. Save + +#### Version tags +- `latest` - the latest version of the Documentserver +- Version tags (eg. `7.0.1-37`) - these tags are equal to the Documentserver version of the `onlyoffice-documentserver` debian package used in the image + +## Building the image yourself +- [Checkout README.md on my GitHub repository](https://github.com/jiriks74/Docker-DocumentServer-Arm64) #### 1. Install `qemu-user`, `qemu-user-static`, `qemu` and `binfmt-support` @@ -33,7 +116,7 @@ `docker-compose up -d` - This will start the server. It is set to be automatically started/restarted so as long you have docker running on startup this will start automatically -## Updating +## Updating the image yourself #### 1. Stop and delete the old container `docker-compose down` @@ -51,25 +134,9 @@ `docker-compose up -d` -## Setup `Secret key`with Nextcloud -1. Uncomment four lines starting with `JWT` in `docker-compose` -2. Set your secret on line `JWT_SECRET=yourSecret` -3. Open Nexcloud's `config.php` (by defauld `/var/www/nextcloud/config/config.php`) -4. Add this to the 2nd last line (before the line with `);`) and paste in your secret (3rd last line) -```php - 'onlyoffice' => - array ( - "jwt_secret" => "yourSecret", - "jwt_header" => "AuthorizationJwt" - ) -``` -5. Go to your Nextcloud settings, navigate to Onlyoffice settings -6. Add your server Address and Secret key -7. Save - --- -## The rest of this file is the official `README.md`. I will not change anything in it, it may not work. If you care about something, make a pull request and we'll figure it out. +## The rest of this file is the official [`README.md` from OnlyOffice-Documentserver repository](https://github.com/ONLYOFFICE/Docker-DocumentServer). I will not change anything in it, it may not work, but considering the changes I made, it should be fully compatible (beware that you must change the `docker-compose.yml` from building the image locally to using this repository). If you want to change something, make a issue on my repository and we'll figure it out.
-- 2.45.2 From f1849ef17feff9b690a46d4808174f999cf27c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 5 Apr 2022 09:32:49 +0200 Subject: [PATCH 21/36] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7ee5c12..873fb0e 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ [![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) [![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) +[![Docker Size](https://img.shields.io/docker/image-size/jiriks74/onlyoffice-documentserver-arm64/latest.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Size&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) [![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer-Arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) - +[![GitHub Forks](https://img.shields.io/github/forks/jiriks74/Docker-DocumentServer-Arm64?color=94398d&label=Forks&logo=github&logoColor=ffffff&style=for-the-badge)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) #### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` #### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well @@ -97,8 +98,7 @@ volumes: - `latest` - the latest version of the Documentserver - Version tags (eg. `7.0.1-37`) - these tags are equal to the Documentserver version of the `onlyoffice-documentserver` debian package used in the image -## Building the image yourself -- [Checkout README.md on my GitHub repository](https://github.com/jiriks74/Docker-DocumentServer-Arm64) +## Building the image yourself (not recommended - takes a lot of time) #### 1. Install `qemu-user`, `qemu-user-static`, `qemu` and `binfmt-support` -- 2.45.2 From 16d5eecd74b20f3c6508a92b0db5d531341a311a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Tue, 5 Apr 2022 13:53:54 +0200 Subject: [PATCH 22/36] Add FAQ This means frequent problems really... --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 873fb0e..73b9862 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,17 @@ volumes: #### 3. Create and start the new container `docker-compose up -d` + +## FAQ + +### The container is up, but OnlyOffice isn't reachable +- (Due to the slow storage of Raspberry Pi and simmilar devices - external SSD may help here) +- The container takes a bit longer to start up. Just wait, it can take up to 5 minutes for OnlyOffice DocumentServer to load. + +### `docker-copose up` results in http timeout +- (Due to the slow storage of the Raspberry Pi and simmilar external SSD may help here again) +- Run this to set larger timeout: + - `export COMPOSE_HTTP_TIMEOUT=360` --- -- 2.45.2 From 39d2e303f120bc7b2e26ab011f36ce57ca3a9c58 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Tue, 12 Apr 2022 19:00:46 +0300 Subject: [PATCH 23/36] Fix disabling JWT --- run-document-server.sh | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 30a3f3b..2ec1b7c 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -67,6 +67,14 @@ NGINX_WORKER_PROCESSES=${NGINX_WORKER_PROCESSES:-1} NGINX_WORKER_CONNECTIONS=${NGINX_WORKER_CONNECTIONS:-$(ulimit -n)} JWT_ENABLED=${JWT_ENABLED:-false} + +# validate user's vars before usinig in json +if [ "${JWT_ENABLED}" == "true" ]; then + JWT_ENABLED="true" +else + JWT_ENABLED="false" +fi + JWT_SECRET=${JWT_SECRET:-secret} JWT_HEADER=${JWT_HEADER:-Authorization} JWT_IN_BODY=${JWT_IN_BODY:-false} @@ -290,28 +298,26 @@ update_redis_settings(){ } update_ds_settings(){ - if [ "${JWT_ENABLED}" == "true" ]; then - ${JSON} -I -e "this.services.CoAuthoring.token.enable.browser = ${JWT_ENABLED}" - ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.inbox = ${JWT_ENABLED}" - ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.outbox = ${JWT_ENABLED}" + ${JSON} -I -e "this.services.CoAuthoring.token.enable.browser = ${JWT_ENABLED}" + ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.inbox = ${JWT_ENABLED}" + ${JSON} -I -e "this.services.CoAuthoring.token.enable.request.outbox = ${JWT_ENABLED}" - ${JSON} -I -e "this.services.CoAuthoring.secret.inbox.string = '${JWT_SECRET}'" - ${JSON} -I -e "this.services.CoAuthoring.secret.outbox.string = '${JWT_SECRET}'" - ${JSON} -I -e "this.services.CoAuthoring.secret.session.string = '${JWT_SECRET}'" + ${JSON} -I -e "this.services.CoAuthoring.secret.inbox.string = '${JWT_SECRET}'" + ${JSON} -I -e "this.services.CoAuthoring.secret.outbox.string = '${JWT_SECRET}'" + ${JSON} -I -e "this.services.CoAuthoring.secret.session.string = '${JWT_SECRET}'" - ${JSON} -I -e "this.services.CoAuthoring.token.inbox.header = '${JWT_HEADER}'" - ${JSON} -I -e "this.services.CoAuthoring.token.outbox.header = '${JWT_HEADER}'" + ${JSON} -I -e "this.services.CoAuthoring.token.inbox.header = '${JWT_HEADER}'" + ${JSON} -I -e "this.services.CoAuthoring.token.outbox.header = '${JWT_HEADER}'" - ${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}" - ${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}" + ${JSON} -I -e "this.services.CoAuthoring.token.inbox.inBody = ${JWT_IN_BODY}" + ${JSON} -I -e "this.services.CoAuthoring.token.outbox.inBody = ${JWT_IN_BODY}" - if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ] && [ "${JWT_ENABLED}" == "true" ]; then - ${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}" - ${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'" - ${JSON_EXAMPLE} -I -e "this.server.token.authorizationHeader = '${JWT_HEADER}'" - fi + if [ -f "${ONLYOFFICE_EXAMPLE_CONFIG}" ]; then + ${JSON_EXAMPLE} -I -e "this.server.token.enable = ${JWT_ENABLED}" + ${JSON_EXAMPLE} -I -e "this.server.token.secret = '${JWT_SECRET}'" + ${JSON_EXAMPLE} -I -e "this.server.token.authorizationHeader = '${JWT_HEADER}'" fi - + if [ "${USE_UNAUTHORIZED_STORAGE}" == "true" ]; then ${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults===undefined)this.services.CoAuthoring.requestDefaults={}" ${JSON} -I -e "if(this.services.CoAuthoring.requestDefaults.rejectUnauthorized===undefined)this.services.CoAuthoring.requestDefaults.rejectUnauthorized=false" -- 2.45.2 From 4fb0a1e712c859881a44d8ea2a975b734f8efb89 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Mon, 25 Apr 2022 17:25:19 +0300 Subject: [PATCH 24/36] Improve SSL certificate detection (#431) --- run-document-server.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 2ec1b7c..35e31f5 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -38,13 +38,13 @@ if [ "${RELEASE_DATE}" != "${PREV_RELEASE_DATE}" ]; then fi SSL_CERTIFICATES_DIR="${DATA_DIR}/certs" -if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/onlyoffice.crt ]]; then - SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/onlyoffice.crt +if [[ -z $SSL_CERTIFICATE_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt ]]; then + SSL_CERTIFICATE_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.crt else SSL_CERTIFICATE_PATH=${SSL_CERTIFICATE_PATH:-${SSL_CERTIFICATES_DIR}/tls.crt} fi -if [[ -z $SSL_KEY_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/onlyoffice.key ]]; then - SSL_KEY_PATH=${SSL_CERTIFICATES_DIR}/onlyoffice.key +if [[ -z $SSL_KEY_PATH ]] && [[ -f ${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.key ]]; then + SSL_KEY_PATH=${SSL_CERTIFICATES_DIR}/${COMPANY_NAME}.key else SSL_KEY_PATH=${SSL_KEY_PATH:-${SSL_CERTIFICATES_DIR}/tls.key} fi -- 2.45.2 From 80acbe974d2e309b07ad7faac5232e5d056af567 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Fri, 29 Apr 2022 14:55:25 +0300 Subject: [PATCH 25/36] Fix bug #53046 : sed error starting container on Arch (#433) --- run-document-server.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/run-document-server.sh b/run-document-server.sh index 35e31f5..c8dcf39 100755 --- a/run-document-server.sh +++ b/run-document-server.sh @@ -410,11 +410,13 @@ update_welcome_page() { WELCOME_PAGE="${APP_DIR}-example/welcome/docker.html" if [[ -e $WELCOME_PAGE ]]; then DOCKER_CONTAINER_ID=$(basename $(cat /proc/1/cpuset)) - if [[ -x $(command -v docker) ]]; then - DOCKER_CONTAINER_NAME=$(docker inspect --format="{{.Name}}" $DOCKER_CONTAINER_ID) - sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_NAME#/}"'/' -i $WELCOME_PAGE - else - sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_ID::12}"'/' -i $WELCOME_PAGE + if (( ${#DOCKER_CONTAINER_ID} >= 12 )); then + if [[ -x $(command -v docker) ]]; then + DOCKER_CONTAINER_NAME=$(docker inspect --format="{{.Name}}" $DOCKER_CONTAINER_ID) + sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_NAME#/}"'/' -i $WELCOME_PAGE + else + sed 's/$(sudo docker ps -q)/'"${DOCKER_CONTAINER_ID::12}"'/' -i $WELCOME_PAGE + fi fi fi } -- 2.45.2 From 452dfeb56d9c2ee8666031b9ccc48857881e8e93 Mon Sep 17 00:00:00 2001 From: Roman Demidov Date: Fri, 29 Apr 2022 14:57:14 +0300 Subject: [PATCH 26/36] Fix bug #56785 (#434) * Fix bug #56785 * Changes for root --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8d8b2c2..69e2e2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,9 @@ ARG ONLYOFFICE_VALUE=onlyoffice RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ apt-get -y update && \ apt-get -yq install wget apt-transport-https gnupg locales && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \ + mkdir -p $HOME/.gnupg && \ + gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/onlyoffice.gpg --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \ + chmod 644 /etc/apt/trusted.gpg.d/onlyoffice.gpg && \ locale-gen en_US.UTF-8 && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ apt-get -yq install \ -- 2.45.2 From 5ce21294067f9346d0efb3f4adc912ebcde73d2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 12 May 2022 21:03:31 +0200 Subject: [PATCH 27/36] Use native version, add compatibility for both amd64 and arm64 --- Dockerfile | 85 +++++++++++++++++------------------------------------- 1 file changed, 26 insertions(+), 59 deletions(-) diff --git a/Dockerfile b/Dockerfile index dc4e455..f097d27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,7 @@ FROM debian:latest -LABEL maintainer="jiriks74" +LABEL maintainer Ascensio System SIA -RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free\ndeb http://deb.debian.org/debian bullseye-updates main contrib non-free\ndeb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list - -RUN mkdir /build -RUN cd /build +RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free\ndeb http://deb.debian.org/debian bullseye-updates main contrib non-free\ndeb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive PG_VERSION=13 @@ -13,7 +10,9 @@ ARG ONLYOFFICE_VALUE=onlyoffice RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ apt-get -y update && \ apt-get -yq install wget apt-transport-https gnupg locales && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \ + mkdir -p $HOME/.gnupg && \ + gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/onlyoffice.gpg --keyserver keyserver.ubuntu.com --recv-keys 0x8320ca65cb2de8e5 && \ + chmod 644 /etc/apt/trusted.gpg.d/onlyoffice.gpg && \ locale-gen en_US.UTF-8 && \ echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections && \ apt-get -yq install \ @@ -66,64 +65,32 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d && \ service redis-server stop && \ service rabbitmq-server stop && \ service supervisor stop && \ - service nginx stop - -RUN apt install qemu binfmt-support qemu-user-static -t bullseye-backports -y - -RUN dpkg --add-architecture amd64 -RUN apt update && apt install libgcc-s1 libgcc-s1:amd64 -y - -RUN cd /build && apt download libc6:amd64 -RUN dpkg-deb -R /build/libc6*.deb /build/libc6 - -RUN sed -i 's/^Package: libc6$/Package: libc6-amd64/' /build/libc6/DEBIAN/control -RUN sed -i 's/^Depends: libgcc-s1, libcrypt1$/#Depends: libgcc-s1, libcrypt1/' /build/libc6/DEBIAN/control - -RUN rm -rf /build/libc6/usr/share/doc -RUN rm -rf /build/libc6/usr/share/lintian - -RUN dpkg-deb -b /build/libc6 /build/libc6-modified.deb -RUN dpkg -i /build/libc6-modified.deb - -RUN cd /build && apt download libstdc++6:amd64 -RUN dpkg-deb -R /build/libstdc++6*.deb /build/stdc - -RUN sed -i 's/^Depends: gcc-10-base (= 10.2.1-6), libc6 (>= 2.23), libgcc-s1 (>= 4.2)$/#Depends: gcc-10-base (= 10.2.1-6), libc6 (>= 2.23), libgcc-s1 (>= 4.2)/' /build/stdc/DEBIAN/control - -RUN dpkg-deb -b /build/stdc /build/libstdc++6-modified.deb -RUN dpkg -i /build/libstdc++6-modified.deb - -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys CB2DE8E5 -RUN echo "deb https://download.onlyoffice.com/repo/debian squeeze main" | tee /etc/apt/sources.list.d/onlyoffice.list - -RUN cd /build && apt update && apt download onlyoffice-documentserver:amd64 -RUN dpkg-deb -R /build/onlyoffice-documentserver*.deb /build/onlyoffice - -RUN sed -i 's/^Depends: debconf (>= 0.5) | debconf-2.0, adduser, ca-certificates, coreutils, curl, libasound2, libcairo2, libcurl3 | libcurl4, libcurl3-gnutls, libgconf-2-4, libgtk-3-0, libstdc++6 (>= 4.8.4), libxml2, libxss1, libxtst6, logrotate, mysql-client | mariadb-client, nginx-extras (>= 1.3.13), postgresql-client (>= 9.1), pwgen, supervisor (>= 3.0b2), xvfb, zlib1g$/Depends: debconf:arm64 (>= 0.5) | debconf-2.0:arm64, adduser:arm64, ca-certificates:arm64, coreutils:arm64, curl:arm64, libasound2:arm64, libcairo2:arm64, libcurl3:arm64 | libcurl4:arm64, libcurl3-gnutls:arm64, libgconf-2-4:arm64, libgtk-3-0:arm64, libstdc++6:amd64 (>= 4.8.4), libxml2:arm64, libxss1:arm64, libxtst6:arm64, logrotate:arm64, mysql-client:arm64 | mariadb-client:arm64, nginx-extras:arm64 (>= 1.3.13), postgresql-client:arm64 (>= 9.1), pwgen:arm64, supervisor:all (>= 3.0b2), xvfb:arm64, zlib1g:arm64/' /build/onlyoffice/DEBIAN/control - -RUN dpkg-deb -b /build/onlyoffice /build/onlyoffice-documentserver-modified.deb - -EXPOSE 80 443 - -ARG COMPANY_NAME=onlyoffice -ARG PRODUCT_NAME=documentserver -ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_amd64.deb" - -ENV COMPANY_NAME=$COMPANY_NAME \ - PRODUCT_NAME=$PRODUCT_NAME - -RUN service postgresql start && \ - apt-get -yq install /build/onlyoffice-documentserver-modified.deb && \ - service postgresql stop && \ - service supervisor stop && \ - rm -rf /build/ && \ - rm -rf /var/log/$COMPANY_NAME && \ + service nginx stop && \ rm -rf /var/lib/apt/lists/* COPY config /app/ds/setup/config/ COPY run-document-server.sh /app/ds/run-document-server.sh -RUN chmod 755 /app/ds/*.sh +EXPOSE 80 443 + +ARG COMPANY_NAME=onlyoffice +ARG PRODUCT_NAME=documentserver +ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_arm64.deb" + +ENV COMPANY_NAME=$COMPANY_NAME \ + PRODUCT_NAME=$PRODUCT_NAME + +RUN RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ + wget -q -P /tmp "http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" + apt-get -y update && \ + service postgresql start && \ + apt-get -yq install /tmp/$(basename "$PACKAGE_URL") && \ + service postgresql stop && \ + service supervisor stop && \ + chmod 755 /app/ds/*.sh && \ + rm -f /tmp/$(basename "$PACKAGE_URL") && \ + rm -rf /var/log/$COMPANY_NAME && \ + rm -rf /var/lib/apt/lists/* VOLUME /var/log/$COMPANY_NAME /var/lib/$COMPANY_NAME /var/www/$COMPANY_NAME/Data /var/lib/postgresql /var/lib/rabbitmq /var/lib/redis /usr/share/fonts/truetype/custom -- 2.45.2 From 37d6dd41fd17b7932fc30dd791629af49fa36e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 12 May 2022 21:11:05 +0200 Subject: [PATCH 28/36] Fix missing && \ --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f097d27..1dbf96b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,7 +81,7 @@ ENV COMPANY_NAME=$COMPANY_NAME \ PRODUCT_NAME=$PRODUCT_NAME RUN RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ - wget -q -P /tmp "http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" + wget -q -P /tmp "http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" && \ apt-get -y update && \ service postgresql start && \ apt-get -yq install /tmp/$(basename "$PACKAGE_URL") && \ -- 2.45.2 From 32eda02f32235425afbfbbe781607bacd49c5b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 12 May 2022 21:12:13 +0200 Subject: [PATCH 29/36] Fix typo (`RUN RUN` in Dockerfile) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1dbf96b..df35415 100644 --- a/Dockerfile +++ b/Dockerfile @@ -80,7 +80,7 @@ ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${C ENV COMPANY_NAME=$COMPANY_NAME \ PRODUCT_NAME=$PRODUCT_NAME -RUN RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ +RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ wget -q -P /tmp "http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" && \ apt-get -y update && \ service postgresql start && \ -- 2.45.2 From 99180c44e44aafc4e7fa535e2f7234d7265c285a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 12 May 2022 21:25:23 +0200 Subject: [PATCH 30/36] Update README Update README to be up to date with the architectures --- README.md | 96 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 78 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 73b9862..a32615a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# FOR ARM64 ONLY - -## Onlyoffice-Documentserver with `arm64` support +# NOW WORKING FOR BOTH `amd64` and `arm64` natively! [![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) [![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) @@ -9,17 +7,79 @@ [![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer-Arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) [![GitHub Forks](https://img.shields.io/github/forks/jiriks74/Docker-DocumentServer-Arm64?color=94398d&label=Forks&logo=github&logoColor=ffffff&style=for-the-badge)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) -#### This runs a modified version of the official deb package with the help of `qemu` and `binfmt` -#### It's also based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well +#### This repository is based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well #### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) -## Requirements -- You have to have `qemu`, `qemu-user`, `qemu-user-static` and `binftm-support` installed on your `arm64` host. - - On Raspberry Pi OS you can do `sudo apt install qemu qemu-user qemu-user-static binfmt-support` - ## Usage -### docker-compose with prebuilt image (recommended) +### `arm64`: +#### docker-compose with prebuilt image (recommended) +
+ +```docker-compose +version: '2' +services: + onlyoffice-documentserver: + image: jiriks74/onlyoffice-documentserver-arm64:latest-arm64 + 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=your_secret_key + #- JWT_HEADER=AuthorizationJwt + #- JWT_IN_BODY=true + ports: + - '88:80' + - '443:443' + stdin_open: true + restart: always + stop_grace_period: 120s + 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' + + 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' + volumes: + - postgresql_data:/var/lib/postgresql + +volumes: + postgresql_data: +``` + +
+ +### `amd64`: +#### docker-compose with prebuilt image (recommended) +
+ ```docker-compose version: '2' services: @@ -77,6 +137,8 @@ services: volumes: postgresql_data: ``` + +
### Setup `Secret key`with Nextcloud 1. Uncomment four lines starting with `JWT` in `docker-compose` @@ -95,24 +157,22 @@ volumes: 7. Save #### Version tags -- `latest` - the latest version of the Documentserver +- `latest` - the latest version of the Documentserver - `amd64` version +- `latest-arm64` - the latest version of the Documentserver - `arm64` version - Version tags (eg. `7.0.1-37`) - these tags are equal to the Documentserver version of the `onlyoffice-documentserver` debian package used in the image + - Add `-arm64` behind version tags to get the `arm64` version ## Building the image yourself (not recommended - takes a lot of time) -#### 1. Install `qemu-user`, `qemu-user-static`, `qemu` and `binfmt-support` - - `sudo apt update && sudo apt install qemu-user qemu-user-static qemu binfmt-support` - -#### 2. Clone the repository (for example to your home directory `cd /home/$USER/`) +#### 1. Clone the repository (for example to your home directory `cd /home/$USER/`) `git clone https://github.com/jiriks74/Docker-DocumentServer-Arm64.git && cd Docker-DocumentServer-Arm64` -#### 3. Build the docker image +#### 2. Build the docker image `docker-compose build` - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow (SSD will probably help, I'm running only on HDD) -#### 4. Create and start the container +#### 3. Create and start the container `docker-compose up -d` - This will start the server. It is set to be automatically started/restarted so as long you have docker running on startup this will start automatically -- 2.45.2 From 3b6095bcf5af7a041d4166801b2892a0a98726ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Thu, 12 May 2022 21:32:54 +0200 Subject: [PATCH 31/36] Update README.md Update README to use new repositories links --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a32615a..0d7a3f5 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # NOW WORKING FOR BOTH `amd64` and `arm64` natively! -[![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) -[![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver-arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) -[![Docker Size](https://img.shields.io/docker/image-size/jiriks74/onlyoffice-documentserver-arm64/latest.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Size&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver-arm64) +[![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) +[![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) +[![Docker Size](https://img.shields.io/docker/image-size/jiriks74/onlyoffice-documentserver/latest.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=Size&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) -[![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer-Arm64.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) -[![GitHub Forks](https://img.shields.io/github/forks/jiriks74/Docker-DocumentServer-Arm64?color=94398d&label=Forks&logo=github&logoColor=ffffff&style=for-the-badge)](https://github.com/jiriks74/Docker-DocumentServer-Arm64) +[![GitHub Stars](https://img.shields.io/github/stars/jiriks74/Docker-DocumentServer.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/jiriks74/Docker-DocumentServer) +[![GitHub Forks](https://img.shields.io/github/forks/jiriks74/Docker-DocumentServer?color=94398d&label=Forks&logo=github&logoColor=ffffff&style=for-the-badge)](https://github.com/jiriks74/Docker-DocumentServer) #### This repository is based on the official `Dockerfile` and `docker-compose.yml` files with all the needed files as well @@ -20,7 +20,7 @@ version: '2' services: onlyoffice-documentserver: - image: jiriks74/onlyoffice-documentserver-arm64:latest-arm64 + image: jiriks74/onlyoffice-documentserver:latest-arm64 container_name: onlyoffice-documentserver depends_on: - onlyoffice-postgresql @@ -84,7 +84,7 @@ volumes: version: '2' services: onlyoffice-documentserver: - image: jiriks74/onlyoffice-documentserver-arm64:latest + image: jiriks74/onlyoffice-documentserver:latest container_name: onlyoffice-documentserver depends_on: - onlyoffice-postgresql -- 2.45.2 From d84ddc9834cdc590d1a928e80bb68f95f029c37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 13 May 2022 04:42:01 +0200 Subject: [PATCH 32/36] Update README.md --- README.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index 0d7a3f5..6162f41 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ volumes: #### 2. Build the docker image `docker-compose build` - - This will take a long time. The things that takte the longes are `dpkg-deb: building package 'onlyoffice-documentserver' in 'onlyoffice-documentserver-modified.deb'` and `Generating presentation themes...` - Both of them take like 20 minutes, it's not stuck, it's just slow (SSD will probably help, I'm running only on HDD) + - This may take some time #### 3. Create and start the container `docker-compose up -d` @@ -193,17 +193,6 @@ volumes: #### 3. Create and start the new container `docker-compose up -d` - -## FAQ - -### The container is up, but OnlyOffice isn't reachable -- (Due to the slow storage of Raspberry Pi and simmilar devices - external SSD may help here) -- The container takes a bit longer to start up. Just wait, it can take up to 5 minutes for OnlyOffice DocumentServer to load. - -### `docker-copose up` results in http timeout -- (Due to the slow storage of the Raspberry Pi and simmilar external SSD may help here again) -- Run this to set larger timeout: - - `export COMPOSE_HTTP_TIMEOUT=360` --- -- 2.45.2 From a94d5c0efaf7b4afcdae2a4f13847b20d10b1755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 13 May 2022 11:21:07 +0200 Subject: [PATCH 33/36] Ensure build process won't break with new debian version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index df35415..2e76392 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:latest +FROM debian:bullseye LABEL maintainer Ascensio System SIA RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free\ndeb http://deb.debian.org/debian bullseye-updates main contrib non-free\ndeb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list -- 2.45.2 From 8384d08c26f2d7ffde382520c0772b359227521c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 13 May 2022 12:21:18 +0200 Subject: [PATCH 34/36] Update README to be inline with new images structure Image structure was changed so that all architectures are included in one tag so docker pulls the correct architecture automatically --- README.md | 88 +++++++++---------------------------------------------- 1 file changed, 14 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 6162f41..75bc221 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NOW WORKING FOR BOTH `amd64` and `arm64` natively! +# NOW WORKING FOR `amd64`, `arm64` and `i386` natively! [![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) [![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) @@ -12,72 +12,8 @@ #### To see how I did it, look [at this comment](https://github.com/ONLYOFFICE/DocumentServer/issues/152#issuecomment-1061902836) - I used this method and put it in `Dockerfile` so you don't have to mess aroud with your system in any weird ways (like in the mentioned comment) ## Usage -### `arm64`: -#### docker-compose with prebuilt image (recommended) -
- -```docker-compose -version: '2' -services: - onlyoffice-documentserver: - image: jiriks74/onlyoffice-documentserver:latest-arm64 - 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=your_secret_key - #- JWT_HEADER=AuthorizationJwt - #- JWT_IN_BODY=true - ports: - - '88:80' - - '443:443' - stdin_open: true - restart: always - stop_grace_period: 120s - 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' - - 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' - volumes: - - postgresql_data:/var/lib/postgresql - -volumes: - postgresql_data: -``` - -
- -### `amd64`: #### docker-compose with prebuilt image (recommended) +- Docker will pull the correct architecture automatically
```docker-compose @@ -156,21 +92,22 @@ volumes: 6. Add your server Address and Secret key 7. Save -#### Version tags +#### Tags used on DockerHub - `latest` - the latest version of the Documentserver - `amd64` version -- `latest-arm64` - the latest version of the Documentserver - `arm64` version - Version tags (eg. `7.0.1-37`) - these tags are equal to the Documentserver version of the `onlyoffice-documentserver` debian package used in the image - - Add `-arm64` behind version tags to get the `arm64` version -## Building the image yourself (not recommended - takes a lot of time) +## Building the image yourself (not recommended - may take a lot of time) #### 1. Clone the repository (for example to your home directory `cd /home/$USER/`) - `git clone https://github.com/jiriks74/Docker-DocumentServer-Arm64.git && cd Docker-DocumentServer-Arm64` + `git clone https://github.com/jiriks74/Docker-DocumentServer.git && cd Docker-DocumentServer` #### 2. Build the docker image +##### Building only for the architecture you are building the image on (when building on Raspberry Pi result will be `arm64`, when on pc result will be `amd64`) `docker-compose build` - - This may take some time + +##### Building for all supported architectures (you have to have your environment setup for emulation of arm64 with `qemu`) + `docker buildx build --platform linux/arm64,linux/amd64,linux/386 . #### 3. Create and start the container `docker-compose up -d` @@ -187,8 +124,11 @@ volumes: `docker rmi $(docker images -f "dangling=true" -q)` #### 4. Rebuild the image without cache - - `docker-compose build` +##### Building only for the architecture you are building the image on (when building on Raspberry Pi result will be `arm64`, when on pc result will be `amd64`) + `docker-compose build` + +##### Building for all supported architectures (you have to have your environment setup for emulation of arm64 with `qemu`) + `docker buildx build --platform linux/arm64,linux/amd64,linux/386 . #### 3. Create and start the new container -- 2.45.2 From f070cdbd1f23437399b38f519ae12cb04e1c951c Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Fri, 13 May 2022 13:42:42 +0200 Subject: [PATCH 35/36] Add script to build and push all images for all architectures automatically This script automatically builds the newest version of the documentserver for all architectures with the correct tags and pushes everything to dockerhub automatically --- Dockerfile | 8 ++++---- build_and_push_all_images.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 build_and_push_all_images.py diff --git a/Dockerfile b/Dockerfile index 2e76392..ab28521 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM debian:bullseye +ARG ARCH= +FROM ${ARCH}debian:bullseye LABEL maintainer Ascensio System SIA RUN echo "deb http://deb.debian.org/debian bullseye main contrib non-free\ndeb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free\ndeb http://deb.debian.org/debian bullseye-updates main contrib non-free\ndeb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list @@ -75,7 +76,6 @@ EXPOSE 80 443 ARG COMPANY_NAME=onlyoffice ARG PRODUCT_NAME=documentserver -ARG PACKAGE_URL="http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_arm64.deb" ENV COMPANY_NAME=$COMPANY_NAME \ PRODUCT_NAME=$PRODUCT_NAME @@ -84,11 +84,11 @@ RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \ wget -q -P /tmp "http://download.onlyoffice.com/install/documentserver/linux/${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" && \ apt-get -y update && \ service postgresql start && \ - apt-get -yq install /tmp/$(basename "$PACKAGE_URL") && \ + apt-get -yq install /tmp/$(basename "${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb") && \ service postgresql stop && \ service supervisor stop && \ chmod 755 /app/ds/*.sh && \ - rm -f /tmp/$(basename "$PACKAGE_URL") && \ + rm -f /tmp/"${COMPANY_NAME}-${PRODUCT_NAME}_${arch}.deb" && \ rm -rf /var/log/$COMPANY_NAME && \ rm -rf /var/lib/apt/lists/* diff --git a/build_and_push_all_images.py b/build_and_push_all_images.py new file mode 100644 index 0000000..aae069a --- /dev/null +++ b/build_and_push_all_images.py @@ -0,0 +1,18 @@ +import requests +import os + +response = requests.get("https://api.github.com/repos/ONLYOFFICE/DocumentServer/releases/latest") + +print('docker buildx build --push --platform linux/arm64,linux/amd64 --tag jiriks74/onlyoffice-documentserver:latest .') +os.system(f'docker buildx build --push --platform linux/arm64,linux/amd64 --tag jiriks74/onlyoffice-documentserver:latest .') +print("///////////////////////////////////////////////////////////////////////////") +print('Build and push ":latest" .........................................finished') +print("///////////////////////////////////////////////////////////////////////////") +print() + +print(f'docker buildx build --push --platform linux/arm64,linux/amd64 --tag jiriks74/onlyoffice-documentserver:{response.json()["name"].replace("ONLYOFFICE-DocumentServer-", "")} .') +os.system(f'docker buildx build --push --platform linux/arm64,linux/amd64 --tag jiriks74/onlyoffice-documentserver:{response.json()["name"].replace("ONLYOFFICE-DocumentServer-", "")} .') +print("///////////////////////////////////////////////////////////////////////////") +print(f'Build and push ":{response.json()["name"].replace("ONLYOFFICE-DocumentServer-", "")}".........................................finished') +print("///////////////////////////////////////////////////////////////////////////") + -- 2.45.2 From b0fe26d31b169fc8814617acaf383c41d1a30d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C5=A0tefka?= Date: Fri, 13 May 2022 17:37:51 +0200 Subject: [PATCH 36/36] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75bc221..4baca2c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NOW WORKING FOR `amd64`, `arm64` and `i386` natively! +# NOW WORKING FOR `amd64` and `arm64` natively! [![Docker Pulls](https://img.shields.io/docker/pulls/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) [![Docker Stars](https://img.shields.io/docker/stars/jiriks74/onlyoffice-documentserver.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/jiriks74/onlyoffice-documentserver) -- 2.45.2