From 67f5dd53e2b0f3a2516febf3fee19efae7948a0c Mon Sep 17 00:00:00 2001 From: roschaefer Date: Sun, 25 Aug 2019 12:49:36 +0200 Subject: [PATCH] Remove the custom entrypoint from the docker image .. add documentation how to setup indices manually. --- neo4j/Dockerfile | 5 ++--- neo4j/README.md | 42 ++++++++++++++++++++++++------------------ neo4j/entrypoint.sh | 21 --------------------- 3 files changed, 26 insertions(+), 42 deletions(-) delete mode 100755 neo4j/entrypoint.sh diff --git a/neo4j/Dockerfile b/neo4j/Dockerfile index 56175e423..1cfa04507 100644 --- a/neo4j/Dockerfile +++ b/neo4j/Dockerfile @@ -5,7 +5,6 @@ ARG BUILD_COMMIT ENV BUILD_COMMIT=$BUILD_COMMIT COPY db_setup.sh /usr/local/bin/db_setup -COPY entrypoint.sh /docker-entrypoint-wrapper.sh -RUN apt-get update && apt-get -y install procps wget + +RUN apt-get update && apt-get -y install wget htop RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.4/apoc-3.5.0.4-all.jar -P plugins/ -ENTRYPOINT ["/docker-entrypoint-wrapper.sh"] diff --git a/neo4j/README.md b/neo4j/README.md index 78c4bc62e..fe8825734 100644 --- a/neo4j/README.md +++ b/neo4j/README.md @@ -18,6 +18,16 @@ docker-compose up You can access Neo4J through [http://localhost:7474/](http://localhost:7474/) for an interactive cypher shell and a visualization of the graph. +### Database Indices and Constraints + +Database indices and constraints need to be created when the database is +running. So start the container with the command above and run: + +```bash +docker-compose exec neo4j db_setup +``` + + ## Installation without Docker Install the community edition of [Neo4j](https://neo4j.com/) along with the plugin @@ -35,6 +45,20 @@ Then make sure to allow Apoc procedures by adding the following line to your Neo ``` dbms.security.procedures.unrestricted=apoc.* ``` +### Database Indices and Constraints + +If you have `cypher-shell` available with your local installation of neo4j you +can run: + +```bash +# in folder neo4j/ +$ cp .env.template .env +$ ./db_setup.sh +``` + +Otherwise, if you don't have `cypher-shell` available, copy the cypher +statements [from the `db_setup.sh` script](https://github.com/Human-Connection/Human-Connection/blob/master/neo4j/db_setup.sh) and paste the scripts into your +[database browser frontend](http://localhost:7474). ### Alternatives @@ -50,21 +74,3 @@ in `backend/.env`. Start Neo4J and confirm the database is running at [http://localhost:7474](http://localhost:7474). -## Database Indices and Constraints - -If you are not running our dedicated Neo4J [docker image](https://hub.docker.com/r/humanconnection/neo4j), -which is the case if you setup Neo4J locally without docker, then you have to -setup unique indices and database constraints manually. - -If you have `cypher-shell` available with your local installation of neo4j you -can run: - -```bash -# in folder neo4j/ -$ cp .env.template .env -$ ./db_setup.sh -``` - -Otherwise, if you don't have `cypher-shell` available, copy the cypher -statements [from the `db_setup.sh` script](https://github.com/Human-Connection/Human-Connection/blob/master/neo4j/db_setup.sh) and paste the scripts into your -[database browser frontend](http://localhost:7474). diff --git a/neo4j/entrypoint.sh b/neo4j/entrypoint.sh deleted file mode 100755 index f9c1afbe1..000000000 --- a/neo4j/entrypoint.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -# credits: https://github.com/javamonkey79 -# https://github.com/neo4j/docker-neo4j/issues/166 - -# turn on bash's job control -set -m - -# Start the primary process and put it in the background -/docker-entrypoint.sh neo4j & - -# Start the helper process -db_setup - -# the my_helper_process might need to know how to wait on the -# primary process to start before it does its work and returns - - -# now we bring the primary process back into the foreground -# and leave it there -fg %1