1
We have recently figured it out, and published our own Docker image with support for Python, Django, Postgres, PotGIS and a few other things.
1
I’ve written a detailed post about Building, Testing and Deploying Django App with Bitbucket Pipelines
It can be a good start for extending it with PostGIS and I will point you in the right direction. In addition to the post, we’ve open sourced Dockerfiles which you can extend to support PostGIS.
You’ll need a good tutorial on installing PostGIS, e.g. try this one.
Start with the centos7-postgresql9.4
Dockerfile, and add commands for installing PostGIS, right before VOLUME
line:
...
# install PostGIS
RUN yum -y install postgis2_94 postgis2_94-client
VOLUME ["/var/lib/pgsql/9.4"]
Finally, you have to enable extensions in database. Add this code to start_postgres.sh
:
if [ -n "${POSTGRESQL_DATABASE}" ]; then
echo "Creating database \"${POSTGRESQL_DATABASE}\"..."
sudo -u postgres psql -c "CREATE DATABASE \"${POSTGRESQL_DATABASE}\" OWNER \"${POSTGRESQL_USER}\";"
# create db gistest, connect to db gistest and create postgis extension
sudo -u postgres psql -c "CREATE DATABASE gistest;\c gistest;CREATE EXTENSION postgis;"
fi
- [Answered ]-How to get queryset value outside of loop in Django template?
- [Answered ]-How to remove label?
- [Answered ]-Newbie – Django Project with Multiple Apps – Unable to render Views
- [Answered ]-Calling Model function in template not working
- [Answered ]-GUI in web (Django) for Python script
Source:stackexchange.com