Skip to content

Running Graphspace using Docker & Docker‐Compose

Mahesh Kasbe edited this page Aug 14, 2023 · 7 revisions

Running Graphspace locally using docker-compose

In order to run graphspace locally using docker you need to install docker & docker-compose in your local machine. before running the docker-compose file make sure you have a docker version >= 20.10.21 & docker-compose version >= 1.25.0. The following instructions should apply to computers running a version of the Linux or OS X operating systems.

  1. Download the GraphSpace code by running git clone https://github.com/Murali-group/GraphSpace.git or by downloading the latest release: https://github.com/Murali-group/GraphSpace/releases. git clone https://github.com/Murali-group/GraphSpace.git

  2. Visit the GraphSpace directory: cd GraphSpace

  3. Now run the command: docker-compose -f docker-compose.yaml up --build (before running this command make sure you don't have any local or docker container running with postgres on same port as 5432)

  4. Once the docker-compose succesfully builds all the images open your browser and visit 0.0.0.0:8000

Running Graphspace with Docker Containers.

In case if the user, developer wants to run the graphspace image using Docker locally (for testing purposes) without using docker-compose file make sure to follow the below commands and instructions to create and run the docker image!

  1. Create the docker network intially: docker network create graphspace_network

  2. Pull the postgres, elasticsearch images & build the graphspace container:

docker pull postgres:9.6
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.5.2

docker build -t graphspace .  (if you are working as a developer and want to reflect same changes in your docker image) 
OR
docker pull maheshkasbe/graphspace:latest 
  1. Now run the postgres image with environment variables as shown here:
docker run -d --name db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=graphspace --network graphspace_network postgres:9.6
  1. Now Create extensions inside our postgres docker container:
docker exec -it db psql -U postgres graphspace

CREATE EXTENSION IF NOT EXISTS "pg_trgm";
CREATE EXTENSION IF NOT EXISTS "btree_gin";
  1. Now up the elasticsearch container using following command: docker run -d --name elasticsearch -p 9200:9200 --network graphspace_network docker.elastic.co/elasticsearch/elasticsearch:7.5.2

  2. At last we are ready to run our Graphspace container: docker run -d --name graphspace_container -p 8000:8000 --network graphspace_network graphspace

  3. Now just open your browser and visit: http://0.0.0.0:8000

Running Graphspace on Production (with production.py file)

In case if you want to test the production file then make sure you have following things configured

  1. The docker-compose.prod.yaml file is responsible to run the graphspace on production and this file points to env file secrets.env for all the secrets and configurations (secrets.env file need to be changed or reconfigured with your values)

  2. Now once we have our secrets configured inside secrets.env file we are ready to launch graphspace on production

  3. Run docker-compose -f docker-compose.prod.yaml up Visit http://0.0.0.0:8000

Clone this wiki locally