Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostGIS Extension? #52

Closed
kmarsh opened this issue Jan 6, 2016 · 17 comments
Closed

PostGIS Extension? #52

kmarsh opened this issue Jan 6, 2016 · 17 comments

Comments

@kmarsh
Copy link

kmarsh commented Jan 6, 2016

Is it possible to get the PostGIS extension working in a database?

I tried running create extension postgis; and got the following error:

ERROR:  could not open extension control file "/usr/share/postgresql/9.4/extension/postgis.control": No such file or directory`

I suppose if you could somehow use the mdillon/postgis Docker image instead of the official Postgres one it'd work. Is it possible to somehow override POSTGRES_IMAGE in the config?

@Flink
Copy link
Contributor

Flink commented Jan 7, 2016

If the postgis image is compatible with the official one, then yeah it should work.
As explained in the README, you just have to define those env var:

export POSTGRES_IMAGE="postgres"
export POSTGRES_IMAGE_VERSION="9.4.4"

@pythdasch
Copy link

I'm very interested about this issue because I'm block with postgis. I tried the other plugins but they aren't fully compatible with the new dokku version... how could I resolve this ?

@sethdeckard
Copy link

@pythdasch, I was able to get this working using the postgis Docker image @willcodeforfoo mentions above, just install the Docker image you want (here's what I have currently):

mdillon/postgis latest f277f6afdf67 2 weeks ago 431.5 MB
mdillon/postgis 9.4 709cb883439d 2 weeks ago 431.5 MB

Then just change the two ENV vars mentioned in the docs to point to an installed PostGIS image and you should be good to use the plugin to create new database containers.

@pythdasch
Copy link

Ok I'll try then, thx for the tips :)

@kmarsh
Copy link
Author

kmarsh commented Jan 22, 2016

@sethdeckard Thanks! Dumb question, where should I set those ENV vars?

@pythdasch
Copy link

Good question @willcodeforfoo. @sethdeckard what is the workflow to achieve what you did ?
I guess you installed postgres plugin, after you did the small tutorial about installing postgis tutorial and putted the env, where ? Also, did you create a database in dokku with the plugin like dokku postgres:create foo or by docker ?

@sethdeckard
Copy link

@willcodeforfoo, You can set them per session or permanently via /etc/environment.

To elaborate /etc/environment would make them available to all users, I wasn't sure if the dokku user needs them as well, perhaps not.

@sethdeckard
Copy link

@pythdasch, Use the docker command to pull the image you want:

(sudo) docker pull mdillon/postgis:latest

Then just set your env vars:

export POSTGRES_IMAGE="mdillon/postgis" 
export POSTGRES_IMAGE_VERSION="latest"

Then you just use the plugin to create a new database.

@pythdasch
Copy link

Thx @sethdeckard I did all of this in my dokku (I'm with digitalocean) but I'm stuck after :
Must I create a database with postgres:create or not? because when I try to link my app to mdillon/postgis image it says that the service doesn't exist. thx for your patience

@sethdeckard
Copy link

Yes, you must create your database with the plugin (postgres:create), the ENV vars are used by it to know which postgres image to use when creating your container.

@pythdasch
Copy link

DAMN it !!! I did it !!! Thanks a lot @sethdeckard :)

@josegonzalez
Copy link
Member

You can't list a service that isn't created ;)

@pythdasch
Copy link

Hi I'm having issue with this trick because of : Error parsing reference: "mdillon/postgis" :9.5.2" is not a valid repository/tag.

@pythdasch
Copy link

I trried also latest but fails also :(

@pythdasch
Copy link

it's ok I did it !

@sebastiangraef
Copy link

sebastiangraef commented Sep 25, 2017

Because I just spent some time on this, I had to run:

dokku postgres:connect DB

and

CREATE EXTENSION postgis;

to get this to work.

@wyozi
Copy link

wyozi commented Mar 24, 2020

FYI postgis has an official docker image you can use now: postgis/postgis

@dokku dokku locked as resolved and limited conversation to collaborators Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants