🛠️
Wazimap technical handbook
  • Introduction
  • System Architecture
    • Database Models
    • IndicatorData
    • Geography Hierarchies
    • Choropleth Maps
    • Determine which instance to use
  • Development
    • Code Deployment
    • Component Architecture
    • Development Process
    • Pull Request Template Explanation
    • Code Review Process
    • Pull Request Template (FE)
    • Webflow Integration
    • Merging webflow exports
    • Rules for Webflow exports
    • Webflow exports & changelog
      • June 2023
      • March 2023
      • February 2023
      • December 2022
      • November 2022
      • October 2022
      • May 2022
      • April 2022
      • March 2022
      • January 2022
      • December 2021
      • November 2021
      • October 2021
    • Translation
    • Map components
  • Testing
    • Testing guidelines
    • Critical Paths
    • GUI Tests
    • Heroku Review Apps
  • Design
    • Iconography
  • Change Proposals
  • NGPx - Template
  • NGP1 - Changing the data model (Implemented)
  • NGP2 - Presenting Geographical Hierarchies to users
  • NGP3 - Change Geography Hierarchies
  • NGP4 - Format configuration
  • NGP5 - Multiple count columns
  • NGP6 - Profile-specific open graph metadata
  • NGP7 - Wazimap profile domain management
  • NGP8 - Replacing Webflow as frontend framework
  • Tutorials
    • Creating a new profile
    • Loading new geographies
    • Loading Data
    • Creating a new admin user
    • Creating a non-admin user for a private profile
    • Changing the Geography level name
    • Deployment to Dokku
  • Configuration
  • Profile Configuration
  • Profile Indicator Configuration
  • Profile Collection Configuration
  • Geographies, hierarchies and versions
  • API
    • General API Information
    • Upload API
    • Task Status
    • Point data API
Powered by GitBook
On this page
  • On the server
  • On your local machine

Was this helpful?

Export as PDF
  1. Tutorials

Deployment to Dokku

PreviousChanging the Geography level nameNextProfile Configuration

Last updated 3 years ago

Was this helpful?

On the server

  • Install

  • Install the .

  • Install the

  • Install the

  • Create a postgis database

dokku postgres:create wazimap-db \
-i kartoza/postgis \
-p <database user password> \
-r <root password> \
-I 11.0-2.5 \
-C "POSTGRES_MULTIPLE_EXTENSIONS=postgis,pg_trgm;POSTGRES_USER=postgres;POSTGRES_PASS=<database user password>"
  • Create a redis database

dokku redis:create wazimap-redis
  • Create a dokku app

dokku apps:create wazimap
  • Link the postgres and redis databases to the app

dokku postgres:link wazimap-db wazimap
dokku redis:link wazimap-redis wazimap
  • Change the database url to use postgis instead of postgres

NEW_URL=$(dokku config:get wazimap DATABASE_URL | sed 's/^postgres/postgis/') dokku config:set wazimap DATABASE_URL=$NEW_URL
  • Setup some environment variables

dokku config:set wazimap \
    AWS_ACCESS_KEY_ID=<access key id> \
    AWS_S3_REGION_NAME=<region name> \
    AWS_SECRET_ACCESS_KEY=<secret key> \
    AWS_STORAGE_BUCKET_NAME=<storage bucket> \
    DEFAULT_FILE_STORAGE=storages.backends.s3boto3.S3Boto3Storage \
    DJANGO_CONFIGURATION=Production \
    DJANGO_DEBUG=False \
    DJANGO_SECRET_KEY=<django secret key>
  • Setup the domain and SSL certificates

dokku domains:add wazimap wazimap.com
dokku letsencrypt:enable wazimap
  • Setup the appropriate proxy ports:

# Wazimap does not listen on port 5000 by default
echo dokku proxy:ports-add wazimap http:80:8000
dokku proxy:ports-add wazimap https:443:8000
dokku proxy:ports-remove wazimap http:80:5000
dokku proxy:ports-remove wazimap https:443:5000

Make sure that large uploads are allowed:

dokku nginx:set wazimap client-max-body-size 100m

On your local machine

  • Add a git remote for deployment git remote add dokku:wazimap

  • Deploy git push dokku staging:master (if deploying the staging branch)

dokku
postgres plugin
letsencrypt plugin
redis plugin