aah Deployment
This document provides an information of deployment checklist and steps involved to prepare aah application for production use.
Note: For production use, it is recommended to create platform targeted application binary using command aah build
and deploy. DO NOT USE aah run
, its not optimized for production.
Table of Contents
Preparation Checklist
- Ensure all the necessary configuration have been done for targeted profile (for e.g:
prod
)- Note: It is highly recommended to keep sensitive details outside the application codebase.
- Use flag
--config /path/to/configfile.conf
on commandrun
- Use Environment variables
- Use flag
- Note: It is highly recommended to keep sensitive details outside the application codebase.
- Add
prod.routes { ... }
intoprod.conf
. This step is not applicable if you have only one domain.- By nature of aah supports domains and sub-domains routing (aka domain routing) out-of-the-box. It is must to configure domain name and port information. You have to define route
host
name in theprod
environment profile. Refer to below example.
- By nature of aah supports domains and sub-domains routing (aka domain routing) out-of-the-box. It is must to configure domain name and port information. You have to define route
- Refer to Cross Compile Build to create platform targeted build artifact.
- Refer to aah application binary to know more about capabilities of app binary.
Deploy the application.
Sample Route Host name config in prod Environment profile
# This is configuration of aahframework.org and docs.aahframework.org websites.
env {
prod {
#...
routes {
domains {
# this section name is same domain config name in the routes.conf
aahframework {
host = "aahframework.org"
# Define port no, if listening port different from serve port
# For example:
# aahframework.org website is running on port 8080
# and get served on port 443 via THUMBAI (https://thumbai.app)
port = "443"
}
# this section name is same domain config name in the routes.conf
docs_aahframework {
host = "docs.aahframework.org"
# Define port no, if listening port different from serve port
# For example:
# docs.aahframework.org website is running on port 8080
# and get served on port 443 via THUMBAI (https://thumbai.app)
port = "443"
}
}
}
#...
}
}