Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perrygeo/docker-postgres
PostgreSQL and PostGIS, dockerized
https://github.com/perrygeo/docker-postgres
Last synced: 5 days ago
JSON representation
PostgreSQL and PostGIS, dockerized
- Host: GitHub
- URL: https://github.com/perrygeo/docker-postgres
- Owner: perrygeo
- Created: 2018-12-20T22:10:02.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-24T12:30:08.000Z (over 3 years ago)
- Last Synced: 2024-08-06T03:06:32.083Z (3 months ago)
- Language: Shell
- Homepage:
- Size: 39.1 KB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker images for Postgres
[![Build Status](https://travis-ci.com/perrygeo/docker-postgres.svg?branch=master)](https://travis-ci.com/perrygeo/docker-postgres)
Check out [`perrygeo/postgres` on Dockerhub](https://hub.docker.com/r/perrygeo/postgres)
This is my take on a Dockerized PostgreSQL 12 database with some useful extensions
including [PostGIS](https://www.postgis.net/) and [TimescaleDB](https://www.timescale.com/).
The primary goal is to quickly launch a local postgres
server for development, one with reasonablly current versions and built from source.Futures goals include launching this as a production grade
Postgres deployment on AWS and Digitial Ocean. Looking at
projects like [Patroni](https://github.com/zalando/patroni) for inspiration.The family tree
```
debian:buster-slim
|
v
python:3.8-slim-buster
|
v
perrygeo/gdal-base:latest
|
V
perrygeo/postgres:latest
```
See [`perrygeo/gdal-base`](https://hub.docker.com/r/perrygeo/gdal-base) for details on the C shared libraries available,
notably GDAL, proj and GEOS for use in PostGIS. The following package versions are built from source:```
POSTGRES_VERSION 12.2
PROTOBUF_VERSION 3.6.1
PROTOBUF_C_VERSION 1.3.1
POSTGIS_VERSION 3.1.0alpha
# TIMESCALE_VERSION 1.7.0 # Not included presently, waiting on pg12 support
```Uses the `docker_entrypoint.sh` script from the offical postgres image
thus most of the best practices described in [the documentation](https://hub.docker.com/_/postgres/)
also apply to this project.## Using the image locally
```
make
```will pull the base image, build the `perrygeo/postgres` image,
then (re)start the database server in the background with your local `pgdata` directory mounted for `$PGDATA`.### Connect with `psql`
```
$ psql -U postgres -h localhost -d db
```### Check postgres logs
The logs live in `$PGDATA/pg_log`. Since pgdata is mounted to the container, you can see them on
your local file system:```
$ tail -f pgdata/pgdata11/pg_log/postgresql-...csv
```### Run commands and login to the running container
```
docker exec postgres-server {command to execute}
```You can use `docker exec -it postgres-server /bin/bash` to get an interactive shell.
## Extending this image
Probably don't. I think you'd have better luck copying this `Dockerfile` and modifying it according to your needs.
## Using it in production
Not yet.
## License
Docker image licensing [is a mess](https://opensource.stackexchange.com/a/7015) and in lieu of clear best practices, I'm making the source code and the associated images on dockerhub available as **public domain**.
I provide no warranty of any kind.
You're on your own if you choose to use any of these resources.
If the images work for you, great!
Please `docker pull` it, fork it, `git clone` it, download it, whatever.
Thanks to github, travis-ci and dockerhub
for donating the computing resources to support open source projects such as this.## Contributing
Ideas for additional drivers or software? Bug fixes? Please create a pull request on this repo with:
* a description.
* code + an automated test for the new functionality.
* results of trying it in production.If your proposal is aligned with the project's goals, I'll gladly accept it!