Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
# syntax=docker/dockerfile:1
FROM denoland/deno:2.9.6 AS deno
FROM rust:latest AS chef
ENV SQLX_OFFLINE=true
ENV CARGO_PROFILE_DEV_DEBUG=0
WORKDIR /app
FROM chef AS builder
ARG CARGO_BUILD_JOBS=0
COPY . .
# Build ALL standard service binaries at once (with BuildKit cache mounts for incremental builds)
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=shared \
--mount=type=cache,target=/usr/local/cargo/git/db,sharing=shared \
--mount=type=cache,target=/app/target,id=rust-target-dev-debug,sharing=locked \
jobs="${CARGO_BUILD_JOBS:-0}" \
&& if [ -z "${jobs}" ] || [ "${jobs}" = "0" ]; then jobs="$(nproc)"; fi \
&& cargo build -j "${jobs}" \
--bin authentication_service \
--bin connection_gateway_service \
--bin contacts_service \
--bin document_storage_service \
--bin document_upload_finalizer_local_worker \
--bin email_service \
--bin pubsub_workers \
--bin notification_service \
--bin static_file_service \
--bin unfurl_service \
--bin image_proxy_service \
--bin agent_harness_service \
&& mkdir -p /app/out \
&& cp /app/target/debug/authentication_service /app/out/ \
&& cp /app/target/debug/connection_gateway_service /app/out/ \
&& cp /app/target/debug/contacts_service /app/out/ \
&& cp /app/target/debug/document_storage_service /app/out/ \
&& cp /app/target/debug/document_upload_finalizer_local_worker /app/out/ \
&& cp /app/target/debug/email_service /app/out/ \
&& cp /app/target/debug/pubsub_workers /app/out/ \
&& cp /app/target/debug/notification_service /app/out/ \
&& cp /app/target/debug/static_file_service /app/out/ \
&& cp /app/target/debug/unfurl_service /app/out/ \
&& cp /app/target/debug/image_proxy_service /app/out/ \
&& cp /app/target/debug/agent_harness_service /app/out/
# Base runtime image
FROM debian:trixie-slim AS base
# docker-cli, for the agent harness's local container provider: it drives the
# host's daemon over the mounted socket, so sandboxes are this container's
# siblings. The client tarball only - the daemon is the host's.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates dumb-init curl docker-cli \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=deno /usr/bin/deno /usr/local/bin/deno
ENV DENO_BINARY=/usr/local/bin/deno
ENV PORT=8080
EXPOSE 8080
FROM base AS services_bundle
COPY --from=builder /app/out/ /app/out/
RUN chmod +x /app/out/*
ENTRYPOINT ["dumb-init", "--"]
# Individual service targets
FROM services_bundle AS authentication_service
CMD ["/app/out/authentication_service"]
FROM services_bundle AS connection_gateway_service
CMD ["/app/out/connection_gateway_service"]
FROM services_bundle AS contacts_service
CMD ["/app/out/contacts_service"]
FROM services_bundle AS document_storage_service
CMD ["/app/out/document_storage_service"]
FROM services_bundle AS email_service
CMD ["/app/out/email_service"]
FROM services_bundle AS notification_service
CMD ["/app/out/notification_service"]
FROM services_bundle AS static_file_service
CMD ["/app/out/static_file_service"]
FROM services_bundle AS unfurl_service
CMD ["/app/out/unfurl_service"]
FROM services_bundle AS image_proxy_service
CMD ["/app/out/image_proxy_service"]