mhelvens / docker-node-neo4j-example Goto Github PK
View Code? Open in Web Editor NEWan example docker image with a node.js server that uses neo4j
License: MIT License
an example docker image with a node.js server that uses neo4j
License: MIT License
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
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
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 https://github.com/mhelvens/docker-node-neo4j-example.git
cd docker-node-neo4j-example
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
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"
}
}
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
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
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 -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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.