Giter VIP home page Giter VIP logo

docker-neo4j's Introduction

Neo4j Community Edition 2.2.3

This repository contains a Docker image of the latest version (2.2.3) of the Neo4j community server. This Docker image of Neo4j provides instructions on how to map a Docker data volume to an already existing data/graph.db store file located on your host machine.

What is Neo4j?

Sponsored by Neo Technology, Neo4j is an open-source NoSQL graph database implemented in Java and Scala. With development starting in 2003, it has been publicly available since 2007. The source code and issue tracking are available on GitHub, with support readily available on Stack Overflow and the Neo4j Google group. Limited only by hardware, Neo4j is used today by hundreds of thousands of users in almost all industries. Use cases include matchmaking, network management, software analytics, scientific research, routing, organizational and project management, recommendations, social networks, and more.

Build Docker Image

To build the source from the Dockerfile as an image:

docker build -t kbastani/docker-neo4j .

Pull Docker Image

This image is automatically built and is available from the Docker registry. Use the following pull command to download the image to your local Docker server.

docker pull kbastani/docker-neo4j

Start Neo4j Container

To run the Neo4j image inside a container after either building it or pulling it, run the following docker command.

docker run -d -p 7474:7474 -v /Users/<user>/path/to/neo4j/data:/opt/data --name graphdb kbastani/docker-neo4j

Make sure to replace the <user> with the user directory that contains your Neo4j graph.db data store files.

Keep in mind that store upgrades are not enabled in the Neo4j configuration by default. The data store version of your Neo4j files on your host machine must be equal to the latest release of Neo4j at the time of building this image.

The /path/to/neo4j/data should be the relative path from your host machine's user home directory to neo4j-community-#.#.#/data directory that has the graph.db database you want to mount to the docker container as a volume.

boot2docker

If you're using boot2docker on Mac OS X then you'll need to do the following steps to access the Neo4j browser on the host machine.

Add a route to the container

$ sudo route add -net 172.17.0.0/16 $(boot2docker ip 2> /dev/null)

This command adds a route from the graphdb container's IP (internal), to the VirtualBox boot2docker VM server IP (external).

Now we need to get the internal IP of the container. Run the following command:

$ docker inspect --format="{{.NetworkSettings.IPAddress}}" graphdb
172.17.0.16

Now that we know what the internal IP address is of the graphdb container, we can access it from the browser or via curl.

$ curl 172.17.0.16:7474
{
  "management" : "http://172.17.0.16:7474/db/manage/",
  "data" : "http://172.17.0.16:7474/db/data/"
}%

Add a host name

All that is left now is to map the container's IP to a host name on the host machine. I've chosen graphdb, however, you're free to map it to whatever host name you'd prefer (except for localhost).

echo 172.17.0.16 graphdb | sudo tee -a /etc/hosts

The Neo4j server container is now accessible on your host machine with the following URL.

http://graphdb:7474/browser

Alternative approach for Mac OS X: Use boot2docker ip

If you don't want to set up a route, you can just use the boot2docker ip to connect to the container.

boot2docker ip  # usually returns 192.168.59.103

The container can be reached from the host via the IP above. Try to access neo4j via your browser http://192.168.59.103:7474 or via curl

$ curl 192.168.59.103:7474
{
  "management" : "http://172.17.0.16:7474/db/manage/",
  "data" : "http://172.17.0.16:7474/db/data/"
}%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.