## Build layer ARG PRODUCT_VERSION ARG BUILD_NUMBER FROM onlyoffice/documentserver:${PRODUCT_VERSION}.${BUILD_NUMBER} as build-stage ARG PRODUCT_VERSION ARG BUILD_NUMBER ENV TAG=v${PRODUCT_VERSION}.${BUILD_NUMBER} 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 WORKDIR /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 ## Final image ARG PRODUCT_VERSION ARG BUILD_NUMBER FROM onlyoffice/documentserver:${PRODUCT_VERSION}.${BUILD_NUMBER} # server 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 # fonts 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 ENV GENERATE_FONTS=false