-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile-fonts
More file actions
87 lines (64 loc) · 3.06 KB
/
Dockerfile-fonts
File metadata and controls
87 lines (64 loc) · 3.06 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
ARG CHROME_VERSION="141.0.7390.55"
FROM debian:stable-slim AS downloader
ARG TARGETARCH
ARG LO_VERSION="26.2.1.1"
ARG ARCH=${TARGETARCH/arm64/aarch64}
ARG ARCH=${ARCH/amd64/x86-64}
ADD https://bin.carbone.io/libreoffice-headless-carbone/LibreOffice_${LO_VERSION}_Linux_${ARCH}_deb.tar.gz /libreoffice.tar.gz
FROM debian:stable-slim AS downloader_onlyoffice
ARG TARGETARCH
ARG OO_VERSION="9.0.4"
ARG ARCH=${TARGETARCH/arm64/aarch64}
ADD https://bin.carbone.io/onlyoffice-converter/onlyoffice-converter-standalone_${OO_VERSION}_${ARCH}.deb /onlyoffice.deb
FROM chromedp/headless-shell:${CHROME_VERSION} AS downloader_chrome-headless
FROM node:22 AS s3_plugin_install
RUN git clone https://github.com/carboneio/carbone-ee-plugin-s3.git && \
cd carbone-ee-plugin-s3 && npm ci --omit=dev && rm -R test
FROM node:22 AS azure_plugin_install
RUN git clone https://github.com/carboneio/carbone-ee-plugin-azure-storage-blob.git && \
cd carbone-ee-plugin-azure-storage-blob && npm i && npm ci --omit=dev
FROM debian:stable-slim
ARG TARGETPLATFORM
ARG TARGETARCH
ARG CARBONE_VERSION="5.4.2"
WORKDIR /tmp
RUN apt update && \
apt install -y libfreetype6 fontconfig libgssapi-krb5-2 unzip libpixman-1-0 dnsutils iputils-ping && \
rm -rf /var/lib/apt/lists/*
# Create Carbone user
RUN useradd -d /app carbone
# Copy the local binary into the image folder "app"
ENV APP_ROOT=/app/
RUN mkdir ${APP_ROOT} && chown -R carbone:nogroup ${APP_ROOT}
WORKDIR ${APP_ROOT}
ADD --chown=carbone:nogroup --chmod=755 https://bin.carbone.io/carbone/carbone-ee-${CARBONE_VERSION}-linux-${TARGETARCH/amd64/x64} ./carbone-ee-linux
COPY --chown=carbone:nogroup --chmod=755 ./docker-entrypoint.sh ./docker-entrypoint.sh
# Include plugins
COPY --chown=carbone:nogroup --from=s3_plugin_install carbone-ee-plugin-s3 /app/plugin-s3/
COPY --chown=carbone:nogroup --from=azure_plugin_install carbone-ee-plugin-azure-storage-blob /app/plugin-azure/
# Include basic fonts
COPY --chown=carbone:nogroup fonts /usr/share/fonts/
COPY carbone-fonts /usr/share/fonts/carbone-fonts
RUN fc-cache -f -v
# Download and install LibreOffice
RUN --mount=type=bind,from=downloader,target=/tmp/libreoffice.tar.gz,source=libreoffice.tar.gz \
tar -zxf /tmp/libreoffice.tar.gz && \
dpkg -i LibreOffice*_Linux_*_deb/DEBS/*.deb && \
rm -r LibreOffice*
# Install onlyoffice
ENV CARBONE_EE_ONLYOFFICEPATH=auto
RUN --mount=type=bind,from=downloader_onlyoffice,target=/tmp/onlyoffice.deb,source=onlyoffice.deb \
dpkg -i /tmp/onlyoffice.deb
# Install Chrome
ENV CARBONE_EE_CHROMEPATH=/opt/headless-shell/headless-shell
RUN --mount=type=bind,from=downloader_chrome-headless,target=/tmp/headless-shell,source=headless-shell \
cp -r /tmp/headless-shell /opt/headless-shell && \
apt update && \
apt install -y libnspr4 libnss3 libexpat1 libfontconfig1 libuuid1 socat && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER carbone
RUN mkdir /app/template && mkdir /app/render && mkdir /app/config && mkdir /app/asset && mkdir /app/plugin && mkdir /app/database
EXPOSE 4000/tcp
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["webserver"]