Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (29 loc) · 1.74 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (29 loc) · 1.74 KB
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
FROM onlyoffice/documentserver:10.0.0 AS builder
RUN apt-get update && apt-get install -y git
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.8/install.sh | bash && \
\. "$HOME/.nvm/nvm.sh" && \
nvm install 20
WORKDIR /build
RUN git clone https://github.com/ONLYOFFICE/server.git
WORKDIR /build/server
RUN full_ver=$(dpkg -s onlyoffice-documentserver | awk -F': ' '/^Version:/ {print $2}') && ver=$(echo "$full_ver" | cut -d'-' -f1) && number=$(echo "$full_ver" | cut -d'-' -f2) && \
sed -i \
-e "s/const buildVersion = '.*';/const buildVersion = '$ver';/" \
-e "s/const buildNumber = .*/const buildNumber = $number;/" \
Common/sources/commondefines.js && \
sed -i "s|const buildDate = '.*';|const buildDate = '$(date +"%m/%d/%Y")';|" Common/sources/license.js && \
sed -i 's/exports\.LICENSE_CONNECTIONS = 20;/exports.LICENSE_CONNECTIONS = 9999;/; s/exports\.LICENSE_USERS = 20;/exports.LICENSE_USERS = 9999;/' Common/sources/constants.js
RUN \. "$HOME/.nvm/nvm.sh" && \
npm i -g @yao-pkg/pkg && \
npm i && \
cd Common && npm i && npm i axios --save && \
cd ../DocService && npm i
RUN \. "$HOME/.nvm/nvm.sh" && \
cd DocService/ && \
pkg . -t node20-linux --options max_old_space_size=6144 -o docservice
FROM onlyoffice/documentserver:10.0.0 AS documentserver
COPY --from=builder /build/server/DocService/docservice /var/www/onlyoffice/documentserver/server/DocService/docservice
RUN sed -i 's/isSupportEditFeature=()=>!1/isSupportEditFeature=()=>!0/g' /var/www/onlyoffice/documentserver/web-apps/apps/*/mobile/dist/js/app.js;
RUN rm -rf /var/www/onlyoffice/documentserver-example \
&& rm -rf /etc/onlyoffice/documentserver-example \
&& rm -f /etc/nginx/includes/ds-example.conf