Skip to content

Commit

Permalink
Merge pull request #578 from OpenUpSA/dev/deployment-instructions
Browse files Browse the repository at this point in the history
Load balanced deployment update
  • Loading branch information
paulmwatson authored Nov 7, 2024
2 parents ea4e98a + ffdb05b commit e8782cb
Showing 1 changed file with 8 additions and 29 deletions.
37 changes: 8 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,36 +110,15 @@ We use [Black](https://github.com/psf/black) to format our code. You can install

### Deployment instructions

Deployment is to dokku, a Heroku-like environment. To deploy, simply push to the git remote:

git push dokku

Sensitive or environment-specific configuration variables are set as environment variables using `dokku config:set`, the important ones are:

* SERVER_NAME - Flask uses this as the base hostname and port for the server - Flask Blueprint subdomains base from this. If it can't match the Host header in requests to this, it serves a 404 response.
- `pmg.org.za` in production
- `pmg.test:5000` in development
- Flask seems to use this for generating absolute URLs, except when the `X-Forwarded-Host` header is provided, in which case that hostname is used for absolute URLs.
* SESSION_COOKIE_DOMAIN
- `pmg.org.za` in production
- `pmg.test` in dev
* SQLALCHEMY_DATABASE_URI
* FLASK_ENV=production
* AWS_ACCESS_KEY_ID
* AWS_SECRET_ACCESS_KEY
* SENDGRID_API_KEY
* MAIL_PASSWORD
* SECURITY_PASSWORD_SALT
* RUN_PERIODIC_TASKS=true
* SOUNDCLOUD_APP_KEY_ID
* SOUNDCLOUD_APP_KEY_SECRET
* SOUNDCLOUD_USERNAME
* SOUNDCLOUD_PASSWORD
* SOUNDCLOUD_PERIOD_HOURS=6
* MAX_SOUNDCLOUD_BATCH=10
* S3_BUCKET=pmg-assets
* STATIC_HOST=https://static.pmg.org.za/ or http://pmg-assets.s3-website-eu-west-1.amazonaws.com/
Deployment is to dokku, a Heroku-like environment. PMG now runs on two servers with an AWS Application Load Balancer.

git remote add dokku-prod-2 dokku@pmg-aws2.pmg.org.za:pmg-prod
git remote add dokku-prod-3 dokku@pmg-aws3.pmg.org.za:pmg-prod

To deploy push to one server, wait for it to complete, then push to the other server:

git push dokku-prod-2
git push dokku-prod-3

### Reindexing for Search

Expand Down

0 comments on commit e8782cb

Please sign in to comment.