Deployment
Deploying a web application is most certainly specific to the environment being deployed to. With that said, it is increasingly common for cloud providers to allow applications to be deployed using Git.
Some cloud providers, such as Azure, are able to watch our GitHub repo, notice when we push a new commit to a specific branch we define, and clone it for deployment each time we push. Other cloud providers, such as Heroku, allow us to push directly to it. To do so, we just create a git remote that points to our account on the cloud platform. These approaches make deployment really easy.
Deploying to Dokku
These steps assume the file that starts your server is server.js. If it isn't, adjust the steps accordingly. The basic steps to deploy to Dokku are:
- Add your public SSH key to Dokku (your facilitators will help with this)
- Install the Dokku CLI tools.
- In the folder of your Node app, create the Dokku app with
dokku apps:create YOUR_APP_NAME. - Ensure your
package.jsonhas astartscript ofnode server.js. - Push your app to Dokku with
git push dokku your-branch:main.
Resources
- dokku-checklist (select your cohort for a link)