Skip to content

noahg/docker-pgrestapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-pgrestapi

Sets up PGRestAPI in a docker container

PGRestAPI is a Node.js REST API for PostgreSQL Spatial Tables.

  1. Clone this repo

git clone https://github.com/noahg/docker-pgrestapi.git
  1. Configure database or add files

PGRestAPI can serve static shapefiles, mbtiles files, or connect to a Postgres/PostGIS database, among other things. Edit config/settings.js.example with your database settings and/or add some files into appropriate subdirectory under data/ (eg. data/shapefiles/)

For security reasons, it is recommended that you use a READ ONLY PostGreSQL User.

settings.pg.username = 'username';
settings.pg.password = 'password';
settings.pg.server = '127.0.0.1';
settings.pg.port = '5432';
settings.pg.database = 'test';
  1. Build the image

docker build -t="noahg/docker-pgrestapi" docker-pgrestapi/
  1. Run the container daemonized

docker run -d -p 3001:3001 -i noahg/docker-pgrestapi

Try hitting: http://[docker_ip_address]:3001

If you're using boot2docker on OS X, lookup your docker ip address with

boot2docker ip

Helpful stuff

Get container name and check logs:

docker ps
docker logs [container name]

If needed, run the container in interactive mode with bash. Useful for debugging and running things manually.

docker run -p 3001:3001 -t -i noahg/docker-pgrestapi /bin/bash
node app.js

About

Run PGRestAPI (vector tile service) from a docker container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published