forked from anyidea/onlyoffice-ce-docker-license
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (44 loc) · 2.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ARG product_version=8.0.1
ARG build_tag=v8.0.1.50
ARG build_number=1
ARG oo_root='/var/www/onlyoffice/documentserver'
## Setup
FROM onlyoffice/documentserver:${product_version}.${build_number} as setup-stage
ARG product_version
ARG build_number
ARG oo_root
ENV PRODUCT_VERSION=${product_version}
ENV BUILD_NUMBER=${build_number}
ARG build_deps="git make g++ bzip2"
RUN apt-get update && apt-get install -y ${build_deps} && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource-archive-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/nodesource-archive-keyring.gpg] https://deb.nodesource.com/node_16.x $(lsb_release -c -s) main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y nodejs && \
npm install -g pkg grunt grunt-cli && \
rm -rf /var/lib/apt/lists/*
WORKDIR /build
## Clone
FROM setup-stage as clone-stage
ARG build_tag
RUN git clone --quiet --branch $build_tag --depth 1 https://github.com/ONLYOFFICE/build_tools.git /build/build_tools
RUN git clone --quiet --branch $build_tag --depth 1 https://github.com/ONLYOFFICE/server.git /build/server
## Build
FROM clone-stage as path-stage
COPY server.patch /build/server.patch
RUN cd /build/server && git apply --ignore-space-change --ignore-whitespace /build/server.patch
## Build
FROM path-stage as build-stage
# install ms
WORKDIR /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter
RUN npm install ms --save-dev
# build server with license checks patched
WORKDIR /build/server
RUN make
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/FileConverter --targets=node16-linux -o /build/converter
RUN pkg /build/build_tools/out/linux_64/onlyoffice/documentserver/server/DocService --targets=node16-linux --options max_old_space_size=4096 -o /build/docservice
## Final image
FROM onlyoffice/documentserver:${product_version}.${build_number}
ARG oo_root
#server
COPY --from=build-stage /build/converter ${oo_root}/server/FileConverter/converter
COPY --from=build-stage /build/docservice ${oo_root}/server/DocService/docservice