diff --git a/README.md b/README.md index 1e950af..745361d 100644 --- a/README.md +++ b/README.md @@ -95,3 +95,23 @@ await run(options).catch((err: any) => { process.exit(0); }); ``` + +## Production + +Build Docker image for the AI agent + +```sh +pnpm agent:build +``` + +> [!WARNING] +> +> When building the Docker image on your MacBook, you need to disable Rosetta on Docker Desktop due to issue Buildx throws Illegal Instruction installing ca-certificates when building for linux/amd64 on M2. +> +> Open Docker Desktop, go to "Settings", visit "Generaral", under "Virtual Machine Options", disable option "Use Rosetta for x86_64/amd64 emulation on Apple Silicon". Apply and restart Docker Desktop. + +Push the Docker image to Google Cloud + +```sh +pnpm agent:push +``` diff --git a/package.json b/package.json index 8b7d656..e2b9f02 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,9 @@ "description": "This is the root of the monorepo for the GitHub demo.", "scripts": { "preinstall": "pnpm registry-login", - "registry-login": "pnpm exec artifactregistry-auth" + "registry-login": "pnpm exec artifactregistry-auth", + "agent:build": "docker buildx build --no-cache --platform linux/amd64 -t vertesia/github-agent:latest -t vertesia/github-agent:$(git rev-parse HEAD) -t us-docker.pkg.dev/dengenlabs/us.gcr.io/agents/vertesia/github-agent:$(git rev-parse HEAD) -f apps/github-agent/Dockerfile .", + "agent:push": "cd apps/github-agent && docker push us-docker.pkg.dev/dengenlabs/us.gcr.io/agents/vertesia/github-agent:$(git rev-parse HEAD)" }, "packageManager": "pnpm@9.15.0", "devDependencies": {