2022-09-24 13:04:27 +08:00
|
|
|
ARG product_version=7.2.0
|
|
|
|
ARG build_number=204
|
2021-02-16 04:23:46 +08:00
|
|
|
ARG oo_root='/var/www/onlyoffice/documentserver'
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
## Setup
|
|
|
|
FROM onlyoffice/documentserver:${product_version}.${build_number} as setup-stage
|
2020-10-18 20:36:58 +08:00
|
|
|
ARG product_version
|
|
|
|
ARG build_number
|
2021-02-16 04:23:46 +08:00
|
|
|
ARG oo_root
|
|
|
|
|
|
|
|
ENV PRODUCT_VERSION=${product_version}
|
|
|
|
ENV BUILD_NUMBER=${build_number}
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
ARG build_deps="git make g++ nodejs npm"
|
|
|
|
RUN apt-get update && apt-get install -y ${build_deps}
|
2022-05-18 17:03:45 +08:00
|
|
|
RUN npm install -g pkg grunt grunt-cli
|
2020-12-28 04:02:07 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
WORKDIR /build
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2022-06-30 11:52:09 +08:00
|
|
|
|
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
## Clone
|
|
|
|
FROM setup-stage as clone-stage
|
|
|
|
ARG tag=v${PRODUCT_VERSION}.${BUILD_NUMBER}
|
2021-02-16 04:23:46 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
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/server.git /build/server
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2022-03-24 18:14:48 +08:00
|
|
|
COPY server.patch /build/server.patch
|
2021-05-21 16:54:28 +08:00
|
|
|
RUN cd /build/server && git apply /build/server.patch
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2022-06-30 11:52:09 +08:00
|
|
|
# Clone old version of sdk and webapp to get an old version of the mobile editor
|
2020-10-18 20:36:58 +08:00
|
|
|
|
2022-06-30 11:52:09 +08:00
|
|
|
ARG tag=v6.3.1.79 # Working mobile editor
|
|
|
|
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/sdkjs.git /build/sdkjs
|
|
|
|
RUN git clone --quiet --branch $tag --depth 1 https://github.com/ONLYOFFICE/web-apps.git /build/web-apps
|
|
|
|
COPY web-apps.patch /build/
|
|
|
|
RUN cd /build/web-apps && git apply /build/web-apps.patch
|
2021-02-16 04:23:46 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
## Build
|
2022-06-30 11:52:09 +08:00
|
|
|
FROM clone-stage as build-stage
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2021-05-16 21:40:41 +08:00
|
|
|
# build server with license checks patched
|
2021-05-21 16:54:28 +08:00
|
|
|
WORKDIR /build/server
|
|
|
|
RUN make
|
2022-05-17 21:22:05 +08:00
|
|
|
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node14-linux -o /build/converter
|
|
|
|
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node14-linux --options max_old_space_size=4096 -o /build/docservice
|
2021-05-16 21:40:41 +08:00
|
|
|
|
2022-05-18 17:03:45 +08:00
|
|
|
# build web-apps with mobile editing
|
|
|
|
WORKDIR /build/web-apps/build
|
|
|
|
RUN npm install
|
|
|
|
RUN grunt
|
2021-05-16 21:40:41 +08:00
|
|
|
|
|
|
|
## Final image
|
2021-02-16 04:23:46 +08:00
|
|
|
FROM onlyoffice/documentserver:${product_version}.${build_number}
|
|
|
|
ARG oo_root
|
2020-03-30 23:44:55 +08:00
|
|
|
|
2022-03-24 18:14:48 +08:00
|
|
|
#server
|
2021-05-16 21:40:41 +08:00
|
|
|
COPY --from=build-stage /build/converter ${oo_root}/server/FileConverter/converter
|
2022-05-10 19:02:51 +08:00
|
|
|
COPY --from=build-stage /build/docservice ${oo_root}/server/DocService/docservice
|
|
|
|
|
2022-05-18 17:03:45 +08:00
|
|
|
# Restore mobile editing using an old version of mobile editor
|
|
|
|
COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/documenteditor/mobile ${oo_root}/web-apps/apps/documenteditor/mobile
|
|
|
|
COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/presentationeditor/mobile ${oo_root}/web-apps/apps/presentationeditor/mobile
|
|
|
|
COPY --from=build-stage /build/web-apps/deploy/web-apps/apps/spreadsheeteditor/mobile ${oo_root}/web-apps/apps/spreadsheeteditor/mobile
|