Skip to content

Deployment

Mako ships with a production-ready Dockerfile.

Terminal window
# Build the image
docker build -t mako .
# Run it
docker run -p 8080:8080 \
-e DATABASE_URL=mongodb://your-mongodb-url/mako \
-e ENCRYPTION_KEY=your-32-byte-hex-key \
-e SESSION_SECRET=your-session-secret \
-e OPENAI_API_KEY=your-openai-key \
mako

The image bundles both the API and the pre-built React frontend. The API serves the frontend from /public.

Terminal window
# Start MongoDB + app
pnpm run docker:up
# Stop
pnpm run docker:down
# Clean (removes volumes)
pnpm run docker:clean

Mako includes a deploy script for Cloud Run:

Terminal window
# Runs lint, build, local verification, then deploys
./deploy.sh

The script:

  1. Installs dependencies
  2. Runs ESLint
  3. Builds both app and API
  4. Starts the API locally to verify it boots
  5. Builds Docker image and pushes to Google Artifact Registry
  6. Deploys to Cloud Run

Set these in Cloud Run’s environment configuration (or via cloud-run-env.yaml):

VariableRequiredPurpose
DATABASE_URLYesMongoDB connection string
ENCRYPTION_KEYYesCredential encryption
SESSION_SECRETYesSession security
BASE_URLYesPublic URL (e.g., https://app.mako.ai)
CLIENT_URLYesSame as BASE_URL for Cloud Run
OPENAI_API_KEYRecommendedAI features
ANTHROPIC_API_KEYOptionalAnthropic models
GOOGLE_GENERATIVE_AI_API_KEYOptionalGoogle models
GOOGLE_CLIENT_ID + SECRETOptionalGoogle OAuth
GH_CLIENT_ID + SECRETOptionalGitHub OAuth
SENDGRID_API_KEYOptionalEmail invitations

The cloudflare/ directory contains Cloudflare Workers configuration for edge routing and proxy functionality.