ASTRODOCK documentation Home GitHub

Reference

app.json & env reference

The precise lookup page: every field in app.json with its type and default, the full catalog of reserved ASTRODOCK_* variables (and when each one is present), and the shape of an app-declared env[] entry. For the how-and-why, see App structure & app.json.

app.json schema

Plain JSON, no comments. The CLI and the platform validate against this schema, so a malformed manifest is caught at apply.

Top level

FieldTypeReqDefaultNotes
schemaVersionstringyesMust be "1".
slugstringyesPattern ^[a-z0-9-]+$, max 40 chars. Immutable identity — names the process/container, internal DB, and storage prefix.
namestringyesHuman display name (min length 1).
descriptionstringnoShown in the dashboard.
subdomainstringyesPattern ^[a-z0-9-]+$, max 40 chars. App served at https://<subdomain>.<base-domain>. Mutable.
sourceobjectyesWhere code comes from. See below.
runtimeobjectyesHow the app is built and run. See below.
authobjectyesAuth mode. See below.
databaseobjectyesDatabase mode. See below.
storageobjectyesObject-storage mode. See below.
envarrayno[]App-declared variables (names + metadata). See below.

source

FieldTypeReqDefaultNotes
branchstringno"main"Branch deployed and watched for webhook pushes.
repoPathstringno""Subdirectory to deploy from (monorepos). "" = repo root.
githubRepostringnoowner/repo to connect. Can also be set via the CLI or dashboard.

runtime

FieldTypeReqDefaultNotes
typeenumyes"node" (buildpack) or "docker" (Dockerfile container).
buildCommandstringno"npm run build"Node only. Frontend build command.
dockerfilestringno"Dockerfile"Docker only. Path to the Dockerfile, relative to repoPath.

auth / database / storage

BlockFieldValuesEffect
authmodeplatform · publicplatform injects the auth vars and registers an app secret for /verify; public injects none.
databasemodeinternal · external · noneinternal provisions a Postgres DB and injects ASTRODOCK_DATABASE_URL; external makes that var a required secret you set; none injects nothing.
storagemodeinternal · external · noneinternal provisions a bucket/prefix + key and injects ASTRODOCK_STORAGE_*; external makes those required secrets; none injects nothing.

Change & immutability

FieldBehavior
slugImmutable. Changing it means a new app.
subdomainMutable — triggers a routing re-provision + new TLS certificate.
runtime.typeMutable — the next deploy switches execution path; the old process/container is torn down.
database.mode / storage.modeMutable but non-migrating: switching points the app at a different (or empty) store. No data is copied.

Reserved ASTRODOCK_* variables

The platform injects these into your app at deploy; the app reads them and never sets or declares them. An app-declared key may not start with ASTRODOCK_. "auto" means the platform generates it; "user-required" means an operator must set it before deploy (the external resource modes).

VariablePresent whenSourceMeaning
ASTRODOCK_APP_SLUGalwaysautoApp slug / identity.
ASTRODOCK_APP_NAMEalwaysautoDisplay name.
ASTRODOCK_APP_URLalwaysautoPublic URL, https://<sub>.<domain>.
ASTRODOCK_BASE_DOMAINalwaysautoPlatform base domain.
ASTRODOCK_PORTalwaysautoThe port the server MUST bind.
ASTRODOCK_ENValwaysautoDeploy environment, e.g. production.
ASTRODOCK_DATABASE_URLdatabase ≠ noneauto (internal) / user-required (external)Full connection string. Same name in both modes.
ASTRODOCK_DATABASE_ENGINEdatabase ≠ noneautoThe engine, e.g. postgres.
ASTRODOCK_STORAGE_ENDPOINTstorage ≠ noneauto / user-requiredS3 endpoint URL.
ASTRODOCK_STORAGE_REGIONstorage ≠ noneauto / user-requiredS3 region.
ASTRODOCK_STORAGE_BUCKETstorage ≠ noneauto / user-requiredBucket name.
ASTRODOCK_STORAGE_PREFIXstorage = internalautoApp's key prefix within the shared bucket.
ASTRODOCK_STORAGE_ACCESS_KEYstorage ≠ noneauto / user-requiredS3 access key.
ASTRODOCK_STORAGE_SECRET_KEYstorage ≠ noneauto / user-requiredS3 secret key.
ASTRODOCK_AUTH_URLauth = platformautoControl-plane /verify base URL.
ASTRODOCK_APP_IDauth = platformautoApp ID for /verify (equals the slug).
ASTRODOCK_APP_SECRETauth = platformautoApp secret for /verify.
ASTRODOCK_APP_JWT_SECRETauth = platformautoSecret the app uses to sign its own sessions.

The PORT alias

Because process.env.PORT is near-universal in Node hosting, the platform also exports PORT set to the same value as ASTRODOCK_PORT. This is the single documented unprefixed exception. Prefer ASTRODOCK_PORT in your own code.

One name, internal or external

ASTRODOCK_DATABASE_URL and the ASTRODOCK_STORAGE_* set use the same names whether the resource is internal or external. Your app reads one variable and never knows the difference — moving from the bundled store to a hosted one is a value change, not a code change.

App-declared env[] entries

Each entry in the env array declares one of your variables — its name and metadata only, never its value. Secret values are set out-of-band with astrodock set-secret or in the dashboard.

PropertyTypeReqDefaultMeaning
keystringyesVariable name. Must match ^[A-Z][A-Z0-9_]*$ (UPPER_SNAKE_CASE) and must not start with ASTRODOCK_.
secretbooleannofalseIf true, the value is write-only — masked in the UI/API, set via set-secret, never stored in the manifest.
requiredbooleannofalseIf true, a deploy is blocked until a value exists (the required-variable gate).
defaultstringnoNon-secret default, applied if the operator sets nothing. Not allowed when secret: true.
descriptionstringnoShown in the dashboard and to coding agents.

Example — one required secret and one optional value with a default:

"env": [
  { "key": "OPENAI_API_KEY", "secret": true, "required": true,
    "description": "Used to draft line items" },
  { "key": "INVOICE_PREFIX", "secret": false, "required": false,
    "default": "INV-", "description": "Prefix for invoice numbers" }
]

Two rules the schema enforces

A declared key may never start with ASTRODOCK_ (that prefix is reserved), and default may not be combined with secret: true (a secret has no plaintext default in the manifest).

Setting values

app.json declares variable names; you supply values separately so nothing secret ever lands in git:

# reads the value from stdin — never stored in shell history or the repo
astrodock set-secret OPENAI_API_KEY
astrodock set-secret ASTRODOCK_DATABASE_URL    # external-mode credentials, same command

Non-secret values with a default need nothing set. Required values without a default block the deploy until you set them — see the required-variable gate.

Related