Skip to content
Dockerfile 2.59 KiB
Newer Older
Hugo Renard's avatar
Hugo Renard committed
## Build layer
ARG PRODUCT_VERSION
ARG BUILD_NUMBER
Hugo Renard's avatar
Hugo Renard committed
FROM onlyoffice/documentserver:${PRODUCT_VERSION}.${BUILD_NUMBER} as build-stage
ARG PRODUCT_VERSION
ARG BUILD_NUMBER
Hugo Renard's avatar
Hugo Renard committed
ENV TAG=v${PRODUCT_VERSION}.${BUILD_NUMBER}
Hugo Renard's avatar
Hugo Renard committed
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
Hugo Renard's avatar
Hugo Renard committed
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
Hugo Renard's avatar
Hugo Renard committed
COPY server.patch /build/
RUN git apply /build/server.patch
Hugo Renard's avatar
Hugo Renard committed
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
Hugo Renard's avatar
Hugo Renard committed
RUN mv /etc/onlyoffice/documentserver/default.json /etc/onlyoffice/documentserver/default-origin.json
COPY ./default-override.json /etc/onlyoffice/documentserver/
unteem's avatar
unteem committed
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

## 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
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
# fonts
Hugo Renard's avatar
Hugo Renard committed
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
unteem's avatar
unteem committed

Hugo Renard's avatar
Hugo Renard committed
ENV GENERATE_FONTS=false