apps
Version:
Create, validate, and render Heroku app.json manifests
120 lines (119 loc) • 5.51 kB
HTML
<p><code>app.json</code> is a manifest format for describing web apps. It declares environment
variables, addons, and other information required to run apps on Heroku. This document describes the schema in detail.</p>
<h2 id="example-app-json">Example app.json</h2>
<pre><code class="lang-json">{
"name": "small-sharp-tool",
"description": "This app does one little thing, and does it well.",
"keywords": [
"productivity",
"HTML5",
"scalpel"
],
"website": "https://jane-doe.github.io/small-sharp-tool",
"repository": "https://github.com/jane-doe/small-sharp-tool",
"logo": "https://jane-doe.github.io/small-sharp-tool/logo.svg",
"success_url": "/welcome",
"scripts": {
"postdeploy": "bundle exec rake bootstrap"
},
"env": {
"BUILDPACK_URL": "https://github.com/stomita/heroku-buildpack-phantomjs",
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
"generator": "secret"
},
"WEB_CONCURRENCY": {
"description": "The number of processes to run.",
"default": "5"
}
},
"addons": [
"openredis",
"mongolab:shared-single-small"
]
}
</code></pre>
<h2 id="the-schema">The Schema</h2>
<h3 id="name">name</h3>
<p>A URL-friendly string that uniquely identifies the template app. <em>required string</em></p>
<pre><code class="lang-json">{
"name": "small-sharp-tool"
}
</code></pre>
<h3 id="description">description</h3>
<p>A brief summary of the app: what it does, who it's for, why it exists, etc. <em>optional string</em></p>
<pre><code class="lang-json">{
"description": "This app does one little thing, and does it well."
}
</code></pre>
<h3 id="keywords">keywords</h3>
<p>An array of strings describing the app. <em>optional array</em></p>
<pre><code class="lang-json">{
"keywords": [
"productivity",
"HTML5",
"scalpel"
]
}
</code></pre>
<h3 id="website">website</h3>
<p>The project's website, if there is one. <em>optional string</em></p>
<pre><code class="lang-json">{
"website": "https://jane-doe.github.io/small-sharp-tool"
}
</code></pre>
<h3 id="repository">repository</h3>
<p>The location of the application's source code. Can be a git URL, a GitHub URL, or a tarball URL. <em>optional string</em></p>
<pre><code class="lang-json">{
"repository": "https://github.com/jane-doe/small-sharp-tool"
}
</code></pre>
<h3 id="logo">logo</h3>
<p>The URL of the application's logo image. It's dimensions should be square. Format can be SVG or PNG. <em>optional string</em></p>
<pre><code class="lang-json">{
"logo": "https://jane-doe.github.io/small-sharp-tool/logo.svg"
}
</code></pre>
<h3 id="success_url">success_url</h3>
<p>A URL specifying where to redirect the user once their new app is deployed. If value is a fully-qualified URL, the user should be redirected to that URL. If value is begins with a slash <code>/</code>, the user should be redirected to that path in their newly deployed app. <em>optional string</em></p>
<pre><code class="lang-json">{
"success_url": "/welcome"
}
</code></pre>
<h3 id="scripts">scripts</h3>
<p>A key-value object specifying scripts or shell commands to execute at different stages in the build/release process. <em>optional object</em></p>
<pre><code class="lang-json">{
"scripts": {
"postdeploy": "bundle exec rake bootstrap"
}
}
</code></pre>
<h3 id="env">env</h3>
<p>A key-value object for environment variables, or config vars in Heroku parlance. Keys are the names of the environment variables.</p>
<p>Values can be strings or objects. If the value is a string, it will be used and the user will not be prompted to specify a different value. If the value is an object, it defines specific requirements for that variable:</p>
<p>description - a human-friendly blurb about what the value is for and how to determine what it should be
value - a default value to use
generator - a string representing a function to call to generate the value, such as cookie secret <em>optional object</em></p>
<pre><code class="lang-json">{
"env": {
"BUILDPACK_URL": "https://github.com/stomita/heroku-buildpack-phantomjs",
"SECRET_TOKEN": {
"description": "A secret key for verifying the integrity of signed cookies.",
"generator": "secret"
},
"WEB_CONCURRENCY": {
"description": "The number of processes to run.",
"default": "5"
}
}
}
</code></pre>
<h3 id="addons">addons</h3>
<p>An array of strings specifying Heroku addons to provision on the app before deploying. Each addon should be in the format <code>addon:plan</code>. If plan is omitted, that addon's default plan will be provisioned. <em>optional array</em></p>
<pre><code class="lang-json">{
"addons": [
"openredis",
"mongolab:shared-single-small"
]
}
</code></pre>