Try to bring back more mobile editing features

Refs #18
This commit is contained in:
Alexander Hofbauer 2021-05-16 15:40:41 +02:00
parent c9efc00b7c
commit f44f01ba28
No known key found for this signature in database
GPG key ID: 6421CE3D34E74BA1
4 changed files with 1606 additions and 44 deletions

View file

@ -1,9 +1,11 @@
## Build stage
ARG product_version=6.2.2 ARG product_version=6.2.2
ARG build_number=21 ARG build_number=21
ARG oo_root='/var/www/onlyoffice/documentserver' ARG oo_root='/var/www/onlyoffice/documentserver'
FROM onlyoffice/documentserver:${product_version}.${build_number} as build-stage
## Setup
FROM onlyoffice/documentserver:${product_version}.${build_number} as setup-stage
ARG product_version ARG product_version
ARG build_number ARG build_number
ARG oo_root ARG oo_root
@ -11,56 +13,55 @@ ARG oo_root
ENV PRODUCT_VERSION=${product_version} ENV PRODUCT_VERSION=${product_version}
ENV BUILD_NUMBER=${build_number} ENV BUILD_NUMBER=${build_number}
# Mobile apps patching
ARG me_search='isSupportEditFeature:function(){return!1}'
ARG me_patch='s/isSupportEditFeature:function(){return!1}/isSupportEditFeature:function(){return true}/g'
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/documenteditor/mobile/app.js
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js
RUN grep -q "${me_search}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \
&& sed -si "${me_patch}" ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js
# Rebuild with license checks replaced
ARG build_deps="git make g++ nodejs npm" ARG build_deps="git make g++ nodejs npm"
RUN apt-get update && apt-get install -y ${build_deps} RUN apt-get update && apt-get install -y ${build_deps}
ARG tag=v${product_version}.${build_number}
RUN mkdir /build \
&& git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools \
&& git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server
WORKDIR /build/server
RUN npm install -g pkg grunt grunt-cli RUN npm install -g pkg grunt grunt-cli
COPY license.patch /build/ WORKDIR /build
RUN git apply /build/license.patch
RUN make \
## Clone
FROM setup-stage as clone-stage
ARG tag=v${PRODUCT_VERSION}.${BUILD_NUMBER}
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/web-apps.git /build/web-apps
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server
COPY server.patch /build/
COPY web-apps.patch /build/
RUN cd /build/server && git apply /build/server.patch
RUN cd /build/web-apps && git apply /build/web-apps.patch
## Build
FROM clone-stage as build-stage
# build server with license checks patched
RUN cd /build/server \
&& make \
&& pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node10-linux -o /build/converter \
&& pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice \ && pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node10-linux --options max_old_space_size=4096 -o /build/docservice
&& cp /build/converter ${oo_root}/server/FileConverter/converter \
&& cp /build/docservice ${oo_root}/server/DocService/docservice # build web-apps with mobile editing
RUN cd /build/web-apps/build \
&& npm install \
&& grunt
## Prod image
## Final image
FROM onlyoffice/documentserver:${product_version}.${build_number} FROM onlyoffice/documentserver:${product_version}.${build_number}
ARG oo_root ARG oo_root
COPY --from=build-stage ${oo_root}/web-apps/apps/documenteditor/mobile/app.js \ # server
${oo_root}/web-apps/apps/documenteditor/mobile/app.js COPY --from=build-stage /build/converter ${oo_root}/server/FileConverter/converter
COPY --from=build-stage ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js \ COPY --from=build-stage /build/docservice ${oo_root}/server/DocService/docservice
${oo_root}/web-apps/apps/presentationeditor/mobile/app.js
COPY --from=build-stage ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js \
${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js
COPY --from=build-stage ${oo_root}/server/FileConverter/converter \ # web-apps
${oo_root}/server/FileConverter/converter COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/documenteditor/mobile/app.js ${oo_root}/web-apps/apps/documenteditor/mobile/app.js
COPY --from=build-stage ${oo_root}/server/DocService/docservice \ COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/presentationeditor/mobile/app.js ${oo_root}/web-apps/apps/presentationeditor/mobile/app.js
${oo_root}/server/DocService/docservice COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/spreadsheeteditor/mobile/app.js ${oo_root}/web-apps/apps/spreadsheeteditor/mobile/app.js

View file

@ -4,7 +4,7 @@
## Features ## Features
This [Dockerfile](./Dockerfile) and [patch](license.patch) compile a version of This [Dockerfile](./Dockerfile) and patches compile a version of
OnlyOffice Docs server with mobile editing enabled in the Nextcloud apps for an OnlyOffice Docs server with mobile editing enabled in the Nextcloud apps for an
unlimited amount of concurrent users. unlimited amount of concurrent users.

1561
web-apps.patch Normal file

File diff suppressed because it is too large Load diff