Giter Club home page Giter Club logo

docker-node-neo4j-example's People

Contributors

mhelvens avatar

Watchers

 avatar  avatar  avatar

docker-node-neo4j-example's Issues

docker image `docker-node-neo4j-example:latest` pushed to hub

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
mhelvens/docker-node-neo4j-example   latest              4317be95c007        49 minutes ago      919.1 MB
docker tag 4317be95c007 snewhouse/docker-node-neo4j-example:latest
docker push snewhouse/docker-node-neo4j-example:latest

Pull this image from the hub and rename (tag) it to save you haveing to build it again

Persisting Neo4j data

Hi, have you tried something like this?

--volume=$HOME/neo4j/data:/data : will add a volume (/data) to allow the database to be persisted outside its container

docker run \
--publish=7474:7474 \
--publish=80:80 \
--volume=$HOME/neo4j/data:/data \
mhelvens/docker-node-neo4j-example:latest

more soon

my test: take a look

SJN Looksee

On my macbook:

Darwin MacBook-Pro-6.local 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

git clone

git clone https://github.com/mhelvens/docker-node-neo4j-example.git
cd docker-node-neo4j-example

Build image first

Just tetsing docker build here..and all good

docker build -t mhelvens/docker-node-neo4j-example .
docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
mhelvens/docker-node-neo4j-example   latest              4317be95c007        36 minutes ago      919.1 MB

Edit package.json

saw you were requesting docker run and build from package.json. not sure about this so I :-

removed

    "docker-build": "docker build -t mhelvens/docker-node-neo4j-example .",
    "docker-run":   "docker run -p 80:80 -p 7474:7474 -d mhelvens/docker-node-neo4j-example"

and made a new package.json

{
  "name": "docker-node-neo4j-example",
  "version": "0.1.0",
  "description": "an example docker image with a node.js server that uses neo4j",
  "main": "server.js",
  "scripts": {
    "start":        "node src/server.js",
  },
  "repository": {
    "type": "git",
    "url":  "git+https://github.com/mhelvens/docker-node-neo4j-example.git"
  },
  "author": "Michiel Helvensteijn <[email protected]>",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/mhelvens/docker-node-neo4j-example/issues"
  },
  "homepage": "https://github.com/mhelvens/docker-node-neo4j-example#readme",
  "dependencies": {
    "express": "^4.13.4"
  }
}

run a test

Giving it a whirl....

mkdir -p test
touch ./test/test.sh

echo -e "
docker run \
--publish=7474:7474 \
--publish=80:80 \
--volume=$HOME/neo4j/data:/data \
-d mhelvens/docker-node-neo4j-example:latest" >> ./test/test.sh

chmod 755 ./test/test.sh
bash ./test/test.sh
4de73596de996f0c8d61b14707a309759598a1b36dd7403f9e60f0cc4948d402

Get container ID

# Get container ID
docker ps
CONTAINER ID        IMAGE                                       COMMAND                  CREATED             STATUS              PORTS                                        NAMES
4de73596de99        mhelvens/docker-node-neo4j-example:latest   "/bin/bash entrypoint"   59 seconds ago      Up 58 seconds       0.0.0.0:80->80/tcp, 0.0.0.0:7474->7474/tcp   jovial_heyrovsky

Print app output

docker logs 4de73596de99
Starting Neo4j Server...WARNING: not changing user
process [135]... waiting for server to be ready.... OK.
http://localhost:7474/ is ready.
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~prestart: [email protected]
npm info lifecycle [email protected]~start: [email protected]

> [email protected] start /usr/src/app
> node src/server.js

Running on http://localhost:80

On Mac-OSX go to http://$(docker-machine ip default):80. (http://neo4j.com/developer/docker/)

echo $(docker-machine ip default)

192.168.99.100

curl it

curl -i http://192.168.99.100:80

and all groovy

HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 13
ETag: W/"d-WcoO+p9WM8sDcbvANVR42A"
Date: Thu, 26 May 2016 11:06:52 GMT
Connection: keep-alive

Hello world!

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.