Skip to content

Commit

Permalink
Cleanup/reorganize deployment notes
Browse files Browse the repository at this point in the history
  • Loading branch information
brylie committed Jul 21, 2022
1 parent de75f92 commit 79a6eee
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@

This section is a work-in-progress and outlines issues that arise during or relate to deployment. The main assumption is that we are deploying to [Dokku PaaS](https://dokku.com).

## Configure initial app and database
## Configure initial app and domain

Configure the initial Dokku app and database with the following commands.

- create app `dokku apps:create caregiving-app`
- configure app domain `sudo dokku domains:add caregiving-app <example.com>`
- set `DJANGO_ALLOWED_HOSTS` to include app domain `dokku config:set caregiving-app DJANGO_ALLOWED_HOSTS=<example.com>`
- set `DJANGO_CSRF_TRUSTED_ORIGINS` to include app domain with scheme (e.g., https://) `dokku config:set caregiving-app DJANGO_CSRF_TRUSTED_ORIGINS=<https://example.com>`
- install Postgres plugin `dokku plugin:install https://github.com/dokku/dokku-postgres.git`
- create Postgres DB `dokku postgres:create caregiving-db`
- link DB to app `dokku postgres:link caregiving-db caregiving-app`

## Set up SSL

Enable HTTPS support with the following commands on the Dokku server.

- install Let's Encrypt `dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git`
- configure Let's Encrypt email `sudo dokku config:set --no-restart --global DOKKU_LETSENCRYPT_EMAIL=<[email protected]>`
- enable Let's Encrypt for app `sudo dokku letsencrypt:enable caregiving-app`
- auto-update Let's Encrypt certificate `sudo dokku letsencrypt:cron-job --add`

## Configure app proxy ports
- configure Let's Encrypt email `dokku config:set --no-restart --global DOKKU_LETSENCRYPT_EMAIL=<[email protected]>`
- enable Let's Encrypt for app `dokku letsencrypt:enable caregiving-app`
- auto-update Let's Encrypt certificate `dokku letsencrypt:cron-job --add`'
- `dokku letsencrypt:auto-renew caregiving-app`

We need to configure port 443 to forward to the Django default port 8000 with the following commands.
## Set up database

- clear default proxy ports `dokku proxy:ports-clear caregiving-app`
- configure correct app proxy port `dokku proxy:ports-add caregiving-app https:443:8000`
- install Postgres plugin `dokku plugin:install https://github.com/dokku/dokku-postgres.git`
- create Postgres DB `dokku postgres:create caregiving-db`
- link DB to app `dokku postgres:link caregiving-db caregiving-app`

## Push code from local computer

Expand Down

0 comments on commit 79a6eee

Please sign in to comment.