:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
# syntax=docker/dockerfile:1
# Dockerfile for local agent development - builds on top of sandbox-base
# This image should be rebuilt when the local agent package changes
# Set LOCAL_POSTHOG_CODE_MONOREPO_ROOT to the agent workspace (packages/agent) to use this in DockerSandbox
FROM posthog-sandbox-base
COPY local-workspace/package.json local-workspace/pnpm-lock.yaml local-workspace/pnpm-workspace.yaml /local-workspace/
COPY local-workspace/packages/agent/package.json /local-workspace/packages/agent/package.json
COPY local-workspace/packages/enricher/package.json /local-workspace/packages/enricher/package.json
COPY local-workspace/packages/git/package.json /local-workspace/packages/git/package.json
COPY local-workspace/packages/harness/package.json /local-workspace/packages/harness/package.json
COPY local-workspace/packages/agent-contracts/package.json /local-workspace/packages/agent-contracts/package.json
RUN --mount=type=cache,id=posthog-sandbox-local-pnpm,target=/pnpm/store,sharing=locked \
cd /local-workspace && \
pnpm install --filter @posthog/agent... --ignore-scripts --frozen-lockfile --store-dir=/pnpm/store --fetch-timeout=600000
COPY local-workspace /local-workspace
RUN --mount=type=cache,id=posthog-sandbox-local-pnpm,target=/pnpm/store,sharing=locked \
cd /local-workspace && \
pnpm --filter @posthog/agent... build && \
cd /local-workspace/packages/agent && \
pnpm pack --pack-destination /tmp && \
cd /scripts && \
pnpm install /tmp/posthog-agent-*.tgz --store-dir=/pnpm/store --fetch-timeout=600000 --config.dangerouslyAllowAllBuilds=true && \
rm -rf /tmp/posthog-agent-*.tgz /local-workspace