Prerequisites
- A Heroku account with container registry access
- The Heroku CLI installed
How it works
Heroku dynos have ephemeral filesystems: any files written to disk are lost when the dyno restarts. This deployment configures Compiler to:- Store repository metadata in Heroku Postgres (persistent)
- Clone repositories on demand to
/tmp/repos(ephemeral) - Re-clone missing repositories automatically when someone asks a question
Setup
1
Create a wrapper repository
Create a new repository with the following And a
heroku.yml:heroku.yml
Dockerfile that pulls the Compiler image:Dockerfile
2
Create the Heroku app
3
Add Heroku Postgres
DATABASE_URL environment variable automatically. Heroku Postgres requires SSL, so enable it:4
Add Heroku Key-Value Store
Compiler needs Redis 7 or later, which Heroku provides as Key-Value Store. The app refuses to start without
REDIS_URL. It holds resumable stream state so a client can reconnect to an in-progress response.5
Configure environment variables
PUBLIC_URL to the app’s web URL, which heroku info -a your-app-name shows, or to your custom domain. The MCP server, Slack and links to conversations need it.6
Deploy
7
Finish setup
Open
https://your-app-name-1234.herokuapp.com/setup, fill in the Set up your instance form to create the owner account, and click Save. Setup then walks you through:- Connecting your code, through a GitHub App or a GitLab access token
- Choosing an AI provider, either the Anthropic API or AWS Bedrock
- Creating your first project
Environment variables
The AI provider (Anthropic API or AWS Bedrock), the GitHub App, the GitLab connection, file storage and Slack are configured in the app after first login, not through environment variables. See Environment variables for the optional ones.
Compiler checks for new releases when it starts, including when an eco dyno wakes, and once a day while it runs. It sends
instances.usecompiler.com only its version and an anonymous instance ID, which is derived from TOKEN_ENCRYPTION_KEY and reveals nothing about it. No names, emails, code, conversations or the address your instance is served on are sent. As with any web request, the IP address it comes from reaches our servers and may appear in their logs, but it isn’t saved with the check. Admins then see when a newer release is out at the bottom of Settings. To turn it off, run heroku config:set CHECK_FOR_UPDATES=false -a your-app-name.
Behavior on dyno restart
When a Heroku dyno restarts:- All cloned repositories in
/tmp/reposare lost - Repository metadata remains in Heroku Postgres
- The server starts immediately
- When someone asks a question, Compiler first fetches the project’s repositories and re-clones any that are missing
- The answer starts once the repositories are ready, so the first question after a restart takes longer
Performance considerations
On eco dynos, the app sleeps after 30 minutes of inactivity. Waking up triggers a full restart, so repositories are re-cloned on the first question after it wakes.
Updating
If the upstreamDockerfile changed, pull it first, then push: