nosql-esigelec / inge3a_24

A repository for resources about NoSQL lessons
MIT License
3 stars 1 forks source link

Ajouter TP Neo4j Browser #21

Open bricefotzo opened 11 months ago

bricefotzo commented 11 months ago

Neo4j Docker Workshop Documentation

Introduction

Welcome to the Neo4j Docker workshop! Today, you'll learn how to run a Neo4j database in a Docker container and connect to it using both the Neo4j Browser and the Cypher Shell.

Prerequisites

Neo4j Setup with Docker

  1. Configure Neo4j Services:

    For the Neo4j setup, create a docker-compose.yml file with the following configuration:

    version: '3'
    services:
     neo4j-browser:
       image: neo4j:latest
       container_name: neo4j-browser
       ports:
         - "7474:7474" # HTTP
         - "7687:7687" # Bolt
       environment:
         - NEO4J_AUTH=neo4j/password
     neo4j-shell:
       image: neo4j:latest
       container_name: neo4j-shell
       ports:
         - "7474:7474" # HTTP
         - "7687:7687" # Bolt
  2. Start Neo4j Containers:

    Use Docker Compose to bring up the Neo4j services:

    docker-compose up -d neo4j-browser neo4j-shell
  3. Accessing Neo4j Browser:

    To access the Neo4j Browser, go to http://localhost:7474 in your web browser. Log in with the username neo4j and the password password.

  4. Connecting to Neo4j with Cypher Shell:

    Connect to your local Neo4j instance using the Cypher Shell by running:

    docker exec -it neo4j-shell cypher-shell

    To connect to an external Neo4j AuraDB instance, use:

    docker exec -it neo4j-shell cypher-shell -a neo4j+s://5074307c.databases.neo4j.io -u neo4j -p password

    Make sure to replace password with the actual password for the database.

Conclusion

You now have the knowledge to start a Neo4j database inside a Docker container and interact with it using the Neo4j Browser and Cypher Shell. Enjoy exploring graph