Dockerfile 2.27 KB
Newer Older
Johannes Zellner's avatar
Johannes Zellner committed
1
FROM cloudron/base:1.0.0@sha256:147a648a068a2e746644746bbfb42eb7a50d682437cead3c67c933c546357617
Johannes Zellner's avatar
Johannes Zellner committed
2

3
RUN mkdir -p /app/code
Johannes Zellner's avatar
Johannes Zellner committed
4 5 6
WORKDIR /app/code

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D
Johannes Zellner's avatar
Johannes Zellner committed
7
RUN echo 'deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu1804 ./' >> /etc/apt/sources.list
Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
8 9
# collabora expects hunspell dicts (https://help.nextcloud.com/t/spelling-check-code-3-0/25178/12). NOTE: To add more languages, we have to change loolwsd.xml
# Note that adding more dictionaries requires more memory
10
# apt-cache show loolwsd
Johannes Zellner's avatar
Johannes Zellner committed
11
RUN apt-get update && apt-get install -y loolwsd=4.0.5-2 code-brand=4.0-2 && \
Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
12 13
    apt-get install -y hunspell-en-us hunspell-en-gb hunspell-de-de hunspell-fr && \
    apt-get install -y hyphen-en-us  hyphen-en-gb hyphen-en-gb hyphen-de hyphen-fr && \
14
    apt-get install -y locales && \
Girish Ramakrishnan's avatar
Girish Ramakrishnan committed
15
    rm -rf /var/cache/apt /var/lib/apt/lists
Johannes Zellner's avatar
Johannes Zellner committed
16

17 18 19 20 21 22 23 24
# Generate ssl keys, those are NOT used but required for the admin panel to startup
RUN openssl genrsa -out /etc/loolwsd/root.key.pem 2048 && \
    openssl req -x509 -new -nodes -key /etc/loolwsd/root.key.pem -days 9131 -out /etc/loolwsd/root.crt.pem -subj "/C=DE/ST=BW/L=Berlin/O=Dummy Authority/CN=Dummy Authority" && \
    openssl genrsa -out "/etc/loolwsd/key.pem" 2048 -key "/etc/loolwsd/key.pem" && \
    openssl req -key "/etc/loolwsd/key.pem" -new -sha256 -out "/etc/loolwsd/localhost.csr.pem" -subj "/C=DE/ST=BW/L=Berlin/O=Dummy Authority/CN=localhost" && \
    openssl x509 -req -in /etc/loolwsd/localhost.csr.pem -CA /etc/loolwsd/root.crt.pem -CAkey /etc/loolwsd/root.key.pem -CAcreateserial -out /etc/loolwsd/cert.pem -days 9131 && \
    mv /etc/loolwsd/root.crt.pem /etc/loolwsd/ca-chain.cert.pem

25
RUN rm -rf /etc/loolwsd/loolwsd.xml && ln -s /app/data/loolwsd.xml /etc/loolwsd/loolwsd.xml
Johannes Zellner's avatar
Johannes Zellner committed
26

Johannes Zellner's avatar
Johannes Zellner committed
27 28 29 30 31 32 33 34
RUN sed -e 's,^logfile=.*$,logfile=/run/supervisord.log,' -i /etc/supervisor/supervisord.conf
COPY supervisor/ /etc/supervisor/conf.d/

COPY package.json package-lock.json /app/code/
RUN npm install --production

COPY start.sh nginx.conf loolwsd.xml server.js /app/code/
COPY frontend/ /app/code/frontend/
Johannes Zellner's avatar
Johannes Zellner committed
35

36 37 38 39
# generate the en_US.UTF-8 locale for collabora to open files with special chars
RUN sed -e 's,^# en_US.UTF-8 UTF-8,en_US.UTF-8 UTF-8,' -i /etc/locale.gen && \
    locale-gen

Johannes Zellner's avatar
Johannes Zellner committed
40
CMD [ "/app/code/start.sh" ]