Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Creating a local PostGIS database with Docker
If you're not able to connect to an existing tasking-manager DB, the project ships a Dockerfile that will allow you to run PostGIS locally as follows.
Following must be available locally:
Build & Run the PostGIS dockerfile
- From the root of the project:
docker build -t tasking-manager-db ./devops/docker/postgis
- The image should be downloaded and build locally. Once complete you should see it listed, with
- You can now run the image (this will run PostGIS in a docker container, with port 5432 mapped to localhost):
docker run -d -p 5432:5432 tasking-manager-db
- Confirm the image is running successfully:
- Finally you can set your env variable to point at your containerised DB:
- Refer to the rest of the instructions in the README to setup the DB and run the app
Creating the PostGIS database
It may be the case you would like to set up the database without using Docker for one reason or another. This provides you with a set of commands to create the database and export the database address to allow you to dive into server development.
First, ensure that Postgresql and PostGIS are installed and running on your computer.
Create the database user and database
Assuming you have sudo access and the unix Postgresql owner is
$ sudo -u postgres psql $ CREATE USER "hottm" PASSWORD 'hottm'; $ CREATE DATABASE "tasking-manager" OWNER "hottm"; $ \c "tasking-manager"; $ CREATE EXTENSION postgis;
Finally, add the environmental variable to access the database: