Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

2.1 KB
Raw Blame
FROM ubuntu:noble AS base
ARG SERVICE_NAME=convert_service
WORKDIR /app

# Accept the Microsoft core fonts license
RUN printf '%s\n' "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" > /tmp/ms-fonts-selections \
  && debconf-set-selections /tmp/ms-fonts-selections \
  && rm /tmp/ms-fonts-selections

RUN : \
  && apt-get update \
  && apt-get install -y --no-install-recommends \
  curl \
  tar \
  libreoffice \
  libreofficekit-dev \
  ca-certificates \
  dumb-init \
  libkrb5-3 \
  ttf-mscorefonts-installer \
  wget xfonts-utils \
  cabextract \
  && apt-get clean \
  && rm -rf /var/lib/apt/lists/*

RUN fc-cache -f -v

RUN curl --fail --show-error -L -o core-co-25.04-assets.tar.gz https://github.com/CollaboraOnline/online/releases/download/for-code-assets/core-co-25.04-assets.tar.gz \
  && tar -xvf core-co-25.04-assets.tar.gz \
  && mkdir -p /app/lok \
  && mv instdir /app/lok/instdir \
  && mv include /app/lok/include \
  && rm core-co-25.04-assets.tar.gz

COPY ./prebuilt/nix-store/ /nix/store/
COPY --chmod=755 ./prebuilt/${SERVICE_NAME} /app/svc

# The nix-built binary uses the nix dynamic linker, which doesn't search system
# library paths (/usr/lib, /lib). LibreOfficeKit's libmergedlo.so is loaded via
# dlopen at runtime and depends on system libraries (libz, libfreetype, etc.).
# We symlink system shared libs into the LOK program dir so they are found via
# LD_LIBRARY_PATH, but skip libs that the nix binary provides (glibc, OpenSSL,
# gcc) to avoid version conflicts between nix and system libraries.
RUN for lib in /usr/lib/x86_64-linux-gnu/*.so* /lib/x86_64-linux-gnu/*.so*; do \
      name="$(basename "$lib")"; \
      case "$name" in \
        libc.so*|libm.so*|libdl.so*|librt.so*|libpthread.so*|ld-linux*) continue ;; \
        libssl.so*|libcrypto.so*) continue ;; \
        libgcc_s.so*) continue ;; \
      esac; \
      [ ! -e "/app/lok/instdir/program/$name" ] && ln -s "$lib" "/app/lok/instdir/program/$name" 2>/dev/null || true; \
    done

ENV PORT=8080
ENV LD_LIBRARY_PATH=/app/lok/instdir/program
EXPOSE ${PORT}
ENTRYPOINT ["dumb-init", "./svc"]