Postgres with postgis

I ended up hitting some snags getting this running so I thought I would write down what worked for me to get postgis working.

One note: if you go with the default VM size of shared-cpu-1x - 256, running CREATE EXTENSION postgis causes the db to run out of memory and you see this as a network disconnect. I spent ages thinking the issue was something more sinister!

  1. flyctl postgres create
  2. if you’re using shared-cpu-1x - 256, bump the memory: flyctl scale memory 1024
  3. Clone the postgres-ha repo
  4. Edit the toml.yaml file to use your app name
  5. Modify the Dockerfile to add postgis extensions (example Dockerfile)
  6. Run flyctl deploy
5 Likes