{"id":13558918,"url":"https://github.com/vpicavet/docker-pggis","last_synced_at":"2025-05-12T20:30:49.125Z","repository":{"id":17026179,"uuid":"19790259","full_name":"vpicavet/docker-pggis","owner":"vpicavet","description":"Docker image for GIS-enabled PostgreSQL","archived":false,"fork":false,"pushed_at":"2019-08-07T09:39:32.000Z","size":46,"stargazers_count":57,"open_issues_count":2,"forks_count":21,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-01T10:36:01.600Z","etag":null,"topics":["database","docker","docker-image","gis","pdal","pgrouting","postgis","postgresql"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vpicavet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-14T18:03:28.000Z","updated_at":"2025-02-22T18:30:52.000Z","dependencies_parsed_at":"2022-07-12T18:23:09.931Z","dependency_job_id":null,"html_url":"https://github.com/vpicavet/docker-pggis","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpicavet%2Fdocker-pggis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpicavet%2Fdocker-pggis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpicavet%2Fdocker-pggis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpicavet%2Fdocker-pggis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpicavet","download_url":"https://codeload.github.com/vpicavet/docker-pggis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816663,"owners_count":21968862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","docker","docker-image","gis","pdal","pgrouting","postgis","postgresql"],"created_at":"2024-08-01T12:05:13.915Z","updated_at":"2025-05-12T20:30:48.768Z","avatar_url":"https://github.com/vpicavet.png","language":"Shell","funding_links":[],"categories":["Shell","gis"],"sub_categories":[],"readme":"A PG GIS setup for Docker\n=========================\n\nPresentation\n------------\n\nThis Docker image is a container with all latest PostgreSQL extensions needed to do serious GIS work.\nIt is based on Ubuntu 14.04 and features :\n\n* PostgreSQL 9.5 (from PGDG packages)\n* PostGIS 2.2 (compiled from release sources) with SFCGAL support (git master) and GEOS 3.5\n* PgRouting (git master)\n* PostgreSQL PointCloud extension (git master)\n* OGR Foreign data wrapper (Git master)\n* PDAL (git master)\n\n\nIt creates a pggis database with a pggis superuser (password pggis), with postgis, pgrouting and pointcloud extensions activated. It is therefore ready to eat data, and you can enjoy 2D vector and raster features, 3D support and functions, large point data volumes and analysis, topology support and all PostgreSQL native features.\n\nThis Docker is aimed at tests and development. Do not use it for production purposes. It lacks security and is not micro-service oriented as should a Docker stack be. Use at your own risk. You have been warned.\n\nJust get me started !\n---------------------\n\nMake sure you have docker installed. On Ubuntu 14.04, Docker is named *docker.io*, replace the *docker* by *docker.io* in the following if needed. It is advised to use the latest available Docker version from official packages. See : https://blog.docker.com/2015/07/new-apt-and-yum-repos/\n\nIf you just want to run a container with this image, you do not need this repository as the image is available on docker hub as a Trusted Build.\nJust run the container and it will download the image if you do not already have it locally :\n\n```sh\nsudo docker run --rm -P --name pggis_test oslandia/pggis /sbin/my_init\n```\n\nIf PostgreSQL server does not start and you see a lot of dots on the screen, see Known Problems below.\n\nConnect to the database\n-----------------------\n\nWhen you run the image to create a new container, a database is automatically created on startup, with all extensions activated. the database is named *pggis* and belongs to the *pggis* user, with *pggis* as a password.\n\nAssuming you have the postgresql-client installed, you can use the host-mapped port to test as well. You need to use docker ps to find out what local host port the container is mapped to first:\n\n```sh\n$ sudo docker ps\nCONTAINER ID        IMAGE                   COMMAND                CREATED             STATUS              PORTS                     NAMES\n75fec271dc5e        oslandia/pggis:latest   /usr/lib/postgresql/   51 seconds ago      Up 50 seconds       0.0.0.0:49154-\u003e5432/tcp   pggis_test          \n$ psql -h localhost -p 49154 -d pggis -U pggis --password\n```\n\nAutomatically restore data\n--------------------------\n\nWhen the container runs, it first check its */data/restore* path for *sql* files and *backup* files.\n\nIf there is any backup file present, it will create a new database (named as the file basename), activate all extensions, and restore the backup database.\n\nIf there is any SQL file present, it will similarly create a new database, activate extensions, and load the SQL file into the created database.\n\nTo enable this, you have to map the exposed */data* volume to a host directory when running the image. You can do so using the *-v* option of *docker run*. This host directory should then have a *restore* subdirectory with the backups you want to restore.\n\nExample follows, restoring two backups, one in custom format, another in SQL.\n\n```sh\n$ find /home/user/mydata/\n/home/user/mydata/\n/home/user/mydata/restore\n/home/user/mydata/restore/restore_test.backup\n/home/user/mydata/restore/restore_test2.sql\n/home/user/mydata/otherstuff\n...\n\n$ docker run --rm -P --name pggis_test -v /home/user/mydata:/data oslandia/pggis /sbin/my_init\n\n```\n\nNow if you want to use this repository to build or modify the image, continue reading.\n\nBuild and/or run the container\n------------------------------\n\nGit clone this repository to get the Dockerfile, and cd to it.\n\nYou can build the image with :\n\n```sh\nsudo docker build -t oslandia/pggis .\n```\n\nRun the container with :\n\n```sh\nsudo docker run --rm -P --name pggis_test oslandia/pggis /sbin/my_init\n```\n\nSupport\n=======\n\nDo not hesitate to fork, send pull requests or fill issues on GitHub to enhance this image.\n\nContact Oslandia at infos+pggis@oslandia.com for any question or support.\n\nKnown problems\n==============\n\nWhen using Docker with AUFS, you can hit bug #783, and PostgreSQL server cannot be started due to permission problems. You will see dots appearing on the screen forever. There are at least three alternatives to workaround this bug :\n\n* Wait until the AUFS fix is released and taken into account in Docker ( not released yet as of feb. 2015 )\n\n* Remove containers and images related to this project and rebuild the image from scratch :\n\n```bash\n# WARNING : These lines will stop and delete all your containers and images\n# Be more fine-grained if you have running other containers you want to keep !\nsudo docker stop $(sudo docker ps -a -q)\nsudo docker rm $(sudo docker ps -a -q)\nsudo docker rmi $(sudo docker images -q)\nsudo docker build -t oslandia/pggis .\nsudo docker run --rm -P --name pggis_test oslandia/pggis /sbin/my_init\n```\n\n* Launch bash in the running container, and execute the following lines, PostgreSQL will start\n\n```bash\nsudo docker exec -ti pggis_test bash\nmkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private\n```\n\nReferences\n==========\n\nMore complete documentation on Oslandia's blog post : \nhttp://www.oslandia.com/full-spatial-database-power-in-2-lines-en.html\n\nDockerfile reference :\nhttp://docs.docker.io/reference/builder/\n\nPostgreSQL service example :\nhttp://docs.docker.io/examples/postgresql_service/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpicavet%2Fdocker-pggis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpicavet%2Fdocker-pggis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpicavet%2Fdocker-pggis/lists"}