Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helmi03/docker-postgis
https://index.docker.io/u/helmi03/postgis/
https://github.com/helmi03/docker-postgis
Last synced: 4 days ago
JSON representation
https://index.docker.io/u/helmi03/postgis/
- Host: GitHub
- URL: https://github.com/helmi03/docker-postgis
- Owner: helmi03
- Created: 2013-11-29T02:14:47.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-28T08:20:08.000Z (over 9 years ago)
- Last Synced: 2024-08-02T12:51:32.161Z (3 months ago)
- Language: Shell
- Size: 247 KB
- Stars: 31
- Watchers: 2
- Forks: 40
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred - helmi03/docker-postgis - https://index.docker.io/u/helmi03/postgis/ (others)
README
# Dockerfile PostGIS
## Info
This Dockerfile creates a container running PostGIS 2.1 in PostgreSQL 9.3
- expose port `5432`
- initializes a database in `/var/lib/postgresql/9.3/main`
- superuser in the database: `docker/docker`## Install
- `docker build -t postgis:2.1 .` or `docker build -t postgis:2.1 github.com/helmi03/docker-postgis.git`
- `docker run -d postgis:2.1`## Usage
To connect to database, use docker inspect CONTAINER and grep IPAddress, e.g.
```bash
CONTAINER=$(sudo docker run -d -t helmi03/postgis)
CONTAINER_IP=$(sudo docker inspect -f '{{ .NetworkSettings.IPAddress }}' $CONTAINER)
psql -h $CONTAINER_IP -p 5432 -U docker -W postgres
```## Persistance
You can mount the database directory as a volume to persist your data:
```bash
docker run -d -v $HOME/postgres_data:/var/lib/postgresql postgis:2.1
```Makes sure first need to create source folder: `mkdir -p ~HOME/postgres_data`.
If you copy existing postgresql data, you need to set permission properly (chown/chgrp)
## Meta
Build with docker version `0.7.0`
## References
- Docker trusted build: [helmi03/docker-postgis](https://registry.hub.docker.com/u/helmi03/docker-postgis/)
- [stigi/dockerfile-postgresql](https://github.com/stigi/dockerfile-postgresql)
- [Docker PostgreSQL Service](http://docs.docker.io/en/latest/examples/postgresql_service/)