Predefined variables
DollarDeploy automatically creates environment variables which you can use when deploying your apps.
List of the predefined env vars
APP_HOSTNAME
- primary associated hostname of the appAPP_URL
- https url for primary hostnameAPP_ALIASES
- additional hostnames or blankGIT_TAGS
- latest git hash or tag, automatically updated when deployingGIT_LAST_COMMIT
-+ latest commit message NODE_ENV=production
- automatically set for NodeJS appsUSER_EMAIL
- email address of the user who deploy the app
Docker Compose only
This variables only available in Docker Compose when you deploy the app.
USER_UID
- Current user IDUSER_GID
- Current user group ID
Set during launching an app
These are set if needed during an app launch from a template.
GENERATED_PWD
- 10-char alphanumeric you can use in passwordsGENERATED_HASH
- 32-char alphanumeric you can use in tokens / salt / etcGENERATED_SECRET
- 64-char alphanumeric, compatible withopenssl rand -hex 32
Customize deployment env vars
You can define these vars to control the deployment of your application. These are defined in the app settings.
Deployment options
-
DEPLOY_HOSTNAME_MATCH=0
- Default is 1. If defined and 0, will skip checking hostname matches IP address of the host. Usefull for early IPv6 support and if you use CloudFlare in front of your server. -
NGINX_NO_CANONICAL_REDIRECT=1
- Default is 1. If 0 will disable redirecting to the canonical hostname for the app. Useful if you have wildcard domain managed by Cloudflare in front of your server. -
PRE_START_TIMEOUT=60
- Default is 60s. Amount in seconds to wait for a pre start command to successfully execute. -
POST_START_TIMEOUT=60
- Default is 60s. Amount in seconds to wait for a post start command to successfully execute. -
APP_LISTEN_HOSTNAME=127.0.0.1
- Default is127.0.0.1
. To make app listen on all interfaces and IP addresses, use0.0.0.0
. Only applicable to NodeJS / NextJS apps, or apps which listen to the HOSTNAME parameter. -
APP_INTERNAL_HOSTNAME=127.0.0.1
- Default is127.0.0.1
. Hostname to connect to for reverse proxy and health checks.
Docker-specific options
-
DOCKER_REMOVE_VOLUMES=1
- Default is 0. If 1 will remove volumes when removing the app (dangerous!) -
DOCKER_COMPOSE_BUILD=1
- Default is 0. If defined, docker image will be build everytime you deploy. -
DOCKER_COMPOSE_WAIT_TIMEOUT=120
- Default is 120s. Amount in seconds to wait for docker compose to start the app and wait for all health checks to pass. -
DOCKER_COMPOSE_PULL=policy
- Default is as defined in docker compose, or never if local image exists. Set toDOCKER_COMPOSE_PULL=always
if you use :latest tagged images to update container image on deploy.
Health check options (see https://docs.dollardeploy.com/blog/automatic-health-checks/)
-
APP_READY_TIMEOUT=300
- Default is 300. For how many seconds wait for app to pass health checks. -
APP_HEALTHCHECK_ENABLE=1
- Default is1
. After starting the app, perform the healthchecks to ensure the app is running ok, set to 0 to disable. -
APP_HEALTHCHECK_PATH=/
- Default is/
. HTTP path to check for a health. Can be set to something like/api/health
etc. -
APP_HEALTHCHECK_SUCCESS_CODE=200
- Default is 200, 204, 301, 302. Specify additional http response status code, to qualify app as deployed successfully.
Security options (see https://docs.dollardeploy.com/blog/improved-security-headers-for-all-apps/)
-
APP_HTTP_STRICT_TRANSPORT_SECURITY=max-age=31536000; includeSubDomains; preload
- Default is force HTTPS all the time. Defines HSTS (Strict-Transport-Security) header. Learn more here. -
APP_HTTP_FRAME_OPTIONS=SAMEORIGIN
. Default is to allow iframe embedding only on the same origin. Learn more here. -
APP_HTTP_REFERRER_POLICY=origin-when-cross-origin
. Default is to send hostname in Referer header to external sites, and full URL in the same origin sites. Learn more here. -
APP_HTTP_CONTENT_TYPE_OPTIONS
. There is no default. Sets theX-Content-Type-Options
HTTP header. If set tonosniff
it will prevent browser from autodetecting content types. Make sure to set properContent-Type
header for every resource you serve from your app. Learn more here -
APP_HTTP_CSP_HEADER
. There is no default. Sets theContent-Security-Policy
header to prevent XSS attacks and control resource loading. When configured, this header tells browsers which sources are trusted for scripts, styles, images, and other resources. Learn more here
Additional, framework specific env vars
These mostly disable telemetry or verboseness of the libraries or frameworks in use.
export SEMGREP_SEND_METRICS=off
export COLLECT_LEARNINGS_OPT_OUT=true
export STORYBOOK_DISABLE_TELEMETRY=1
export NEXT_TELEMETRY_DISABLED=1
export SLS_TELEMETRY_DISABLED=1
export SLS_NOTIFICATIONS_MODE=off
export DISABLE_OPENCOLLECTIVE=true
Environment vars available when you add services to the host
POSTGRES_URL
- if you add Postgres service to the hostREDIS_URL
- if you add Redis service to the host