Newer
Older
FROM onlyoffice/documentserver:${PRODUCT_VERSION}.${BUILD_NUMBER} as build-stage
RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get install -y git make g++ nodejs jq
RUN npm install -g pkg grunt grunt-cli
RUN mkdir /build
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
COPY server.patch /build/
RUN git apply /build/server.patch
RUN make
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
RUN mv /etc/onlyoffice/documentserver/default.json /etc/onlyoffice/documentserver/default-origin.json
COPY ./default-override.json /etc/onlyoffice/documentserver/
RUN jq -s '.[0] * .[1]' /etc/onlyoffice/documentserver/default-origin.json /etc/onlyoffice/documentserver/default-override.json -r > /etc/onlyoffice/documentserver/default.json
RUN git clone --quiet https://github.com/ONLYOFFICE/plugin-jitsi.git /build/plugin-jitsi && \
sed "s/meet.jit.si/meet.liiib.re/" -i /build/plugin-jitsi/scripts/code.js
RUN git clone --quiet https://github.com/ONLYOFFICE/plugin-doc2md.git /build/plugin-doc2md
RUN git clone --quiet https://github.com/ONLYOFFICE/plugin-languagetool.git /build/plugin-languagetool
ARG PRODUCT_VERSION
ARG BUILD_NUMBER
FROM onlyoffice/documentserver:${PRODUCT_VERSION}.${BUILD_NUMBER}
COPY --from=build-stage /build/converter /var/www/onlyoffice/documentserver/server/FileConverter/converter
COPY --from=build-stage /build/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice
COPY --from=build-stage --chown=ds:ds /build/plugin-jitsi /var/www/onlyoffice/documentserver/sdkjs-plugins/jitsi
COPY --from=build-stage --chown=ds:ds /build/plugin-doc2md /var/www/onlyoffice/documentserver/sdkjs-plugins/doc2md
COPY --from=build-stage --chown=ds:ds /build/plugin-languagetool /var/www/onlyoffice/documentserver/sdkjs-plugins/languagetool
COPY ./fonts/ /usr/share/fonts/custom/
RUN /usr/bin/documentserver-generate-allfonts.sh true
# config
COPY --from=build-stage /etc/onlyoffice/documentserver/default.json /etc/onlyoffice/documentserver/default.json