Closed sglebs closed 9 years ago
Hi Marcio!
Thank you for your input. Yes it’s a good idea to be able to provide a different PG image, I was thinking to do something like that :)
I don’t have a recommendation for PostGIS at the moment, the only thing needed to work with this plugin is to have a docker image with the same behavior than the postgres one. I will try to find more info on this though.
I created a fork and I am using it to investigate. If I get it working I will update this ticket here and then we can decide how to proceed. Sounds good?
fyi I will try kartoza/postgis first, hardcoded.
Yes it sounds good, thanks :)
I am doing it with https://github.com/Flink/dokku-psql-single-container
The initial attempt failed:
Marcio-Marchinis-MacBook-Pro-Silver:core-server mqm$ ssh dokku@10.10.10.10 postgis:create core-server
-----> Creating database core-server
createdb: database creation failed: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
ERROR: database "core_server" does not exist
-----> Setting config vars for core-server
Marcio-Marchinis-MacBook-Pro-Silver:core-server mqm$
I will google etc and see where it leads me.
I had to patch commands like http://www.wetware.co.nz/2010/07/error-new-encoding-utf8-is-incompatible-with-the-encoding-of-the-template-database-sql_ascii/
createdb -E utf8 -T template0
Now it ran. Let's see if the DB is GIS-enabled...
From this discussion https://github.com/docker-library/postgres/issues/30 it seems that https://github.com/appropriate/docker-postgis could be a good PostGIS image. It’s based on the official docker image so maybe it won’t have the issues you had.
Just made a commit to handle the alternative docker image :) I also tried (really quickly) the PostGIS image from https://registry.hub.docker.com/u/mdillon/postgis/ and I didn’t have any issue to run the PG server.
To make PostGIS work out-of-the-box, the extensions have to be imported:
postgres=# create extension postgis; CREATE EXTENSION postgres=# create extension fuzzystrmatch; CREATE EXTENSION postgres=# create extension postgis_tiger_geocoder; CREATE EXTENSION postgres=# create extension postgis_topology; CREATE EXTENSION
I guess one could leave these steps for the user to manually execute (unlike Heroku does, but like Amazon RDS does - http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.PostGIS)
Ok thank you for the infos :) It’s also possible to do something like this:
echo "create extension postgis; create extension fuzzystrmatch; create extension postgis_tiger_geocoder; create extension postgis_topology;" | dokku psql:admin_console
Thank you for this plugin!
I wanted to have the same thing but with PostGIS support. If I am not mistaken, all I need to do is override the docker image in your functions file, right? So, a few considerations:
1) can you use an env var for the postgre docker image and fallback to your current hardcoded value? This would allow people like me to use PostGIS without having to fork your project just to change your functions file.
2) any recommendations on a good PostGIS docker image? There are so many, and I am not sure they would all be compatible with your plugin. Example: https://github.com/kartoza/docker-postgis
Thanks!