Skip to content

Commit 5eeb1f0

Browse files
Refactoring docker script (#64)
* Adding two parametric script to run Neo4j docker image at specified port * Update Readme * Added help to the docker build commands, extended the Docker-section of the documentation Co-authored-by: Niels de Jong <[email protected]>
1 parent b0bb113 commit 5eeb1f0

File tree

4 files changed

+64
-6
lines changed

4 files changed

+64
-6
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@ To build the app for production:
3535

3636
### Build and run Docker image
3737
Make sure you have a recent version of `docker` installed.
38-
Use the script under `./tools/neodash-build-run.bash` to build the multi-stage NeoDash image & access it with nginx:
38+
On Unix-like system you can run `./tools/neodash-build-run_unix.bash` to build the multi-stage NeoDash image & access it with nginx:
3939
```
4040
$ cd tools/
41-
$ ./neodash-build-run.bash
41+
$ ./neodash-build-run_unix.bash --port=$YOUR_PORT
4242
```
43-
Then go to http://localhost:8080/ in your browser.
43+
If you use Windows, you should have installed WSL. In WSL, you can run the script as follows:
44+
```
45+
$ cd tools/
46+
$ ./neodash-build-run_windows.bash --port=$YOUR_PORT
47+
```
48+
Then visit localhost with the chosen port in your browser.
49+
50+
A pre-built Docker image is available [https://hub.docker.com/r/nielsdejong/neodash](on DockerHub).
4451

4552
## Extending NeoDash
4653
As of v2.0, NeoDash is easy to extend with your own visualizations. There are two steps to take to plug in your own charts:

tools/neodash-build-run.bash

Lines changed: 0 additions & 3 deletions
This file was deleted.

tools/neodash-build-run_unix.bash

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
args=$(getopt -l "port:" -o "p:h" -- "$@")
4+
5+
eval set -- "$args"
6+
7+
while [ $# -ge 1 ]; do
8+
case "$1" in
9+
--)
10+
# No more options left.
11+
shift
12+
break
13+
;;
14+
-p|--port|port)
15+
port="$2"
16+
shift
17+
;;
18+
-h)
19+
echo "Run this script with a '--port 8080' argument to run NeoDash on http://localhost:8080."
20+
exit 0
21+
;;
22+
esac
23+
24+
shift
25+
done
26+
27+
docker build . -t neodash && docker run -it --rm -p $port:80 neodash
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
args=$(getopt -l "port:" -o "p:h" -- "$@")
4+
5+
eval set -- "$args"
6+
7+
while [ $# -ge 1 ]; do
8+
case "$1" in
9+
--)
10+
# No more options left.
11+
shift
12+
break
13+
;;
14+
-p|--port|port)
15+
port="$2"
16+
shift
17+
;;
18+
-h)
19+
echo "Run this script with a '--port 8080' argument to run NeoDash on http://localhost:8080."
20+
exit 0
21+
;;
22+
esac
23+
24+
shift
25+
done
26+
27+
docker build . -t neodash && winpty docker run -it --rm -p $port:80 neodash

0 commit comments

Comments
 (0)