Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bunop committed Mar 18, 2016
1 parent 1f8cb83 commit 647b084
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions compose/postgis/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pg-data/
dump/
33 changes: 33 additions & 0 deletions compose/postgis/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@


Creating a postgis composed image
==========================================

Download and build the images
-----------------------------

Take a look at `docker-compose.yml` for ports to expose. We are using a custom image
which install the [postgis](http://postgis.net/install/) extensions on top of postgres 9.3.
Check the `postgres` password in `docker-compose.yml`, then build the images and create
the container for the first time:

```
$ docker-compose up -d
```

Database dump
-------------

In order to dump database, create a postgis container and link them to database instance:

```
$ docker run -it --volume $PWD/dump:/data --link postgis_db_1:postgres --rm mdillon/postgis:9.3 /bin/bash
```

Then, once inside a container dump the climgen database:

```
$ cd /data/
$ export PGPASSWORD="mysecretpassword"
$ pg_dump --username=postgres -h postgres -d postgres | gzip --best > postgres.sql.gz
```
2 changes: 1 addition & 1 deletion compose/postgis/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ nginx:
volumes_from:
- php
ports:
- "10080:10080"
- "80"
links:
- php

Expand Down
2 changes: 1 addition & 1 deletion compose/postgis/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ upstream php_fpm {
# configuration of the server
server {
# the port your site will be served on
listen 10080;
listen 80;

# the domain name it will serve for
server_name localhost; # substitute your machine's IP address or FQDN
Expand Down

0 comments on commit 647b084

Please sign in to comment.