File tree Expand file tree Collapse file tree 10 files changed +96
-2
lines changed Expand file tree Collapse file tree 10 files changed +96
-2
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,4 @@ jspm_packages
38
38
39
39
# Project Specific
40
40
data
41
- docker-compose.override.yml
41
+ . / docker-compose.override.yml
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ We provide examples of configurations you might use for a specific stack. Each e
87
87
* [Mongo](https://github.com/Osedea/nodock/tree/master/_examples/mongo) - MongoDB + Node + NGINX
88
88
* [RabbitMQ](https://github.com/Osedea/nodock/tree/master/_examples/rabbitmq) - RabbitMQ + Node + NGINX
89
89
* [Memcached](https://github.com/Osedea/nodock/tree/master/_examples/memcached) - Memcached + Node + NGINX
90
+ * [RethinkDB](https://github.com/Osedea/nodock/tree/master/_examples/rethinkdb) - RethinkDB + Node + NGINX
90
91
* [2 Node Apps](https://github.com/Osedea/nodock/tree/master/_examples/2-nodes) - Node + Node + NGINX
91
92
92
93
<a name="Workspace"></a>
Original file line number Diff line number Diff line change
1
+ # docker-compose.override.yml
2
+
3
+ version : ' 2'
4
+
5
+ services :
6
+ node2 : # name of new container
7
+ extends : node # extends the settings from the "node" container
8
+ build :
9
+ context : ./node
10
+ args :
11
+ - PROJECT_PATH=second-app
12
+ entrypoint : run-nodock "node index.js" # the entrypoint for the "node2" container
13
+ nginx :
14
+ ports :
15
+ - " 10000:10000" # the port(s) to forward for the "node2" container
16
+ links :
17
+ - node2 # link "nginx" to "node2"
Original file line number Diff line number Diff line change
1
+ ## RethinkDB Service
2
+
3
+ ### Setup
4
+
5
+ Copy the index file in this folder to the project root:
6
+
7
+ ``` bash
8
+ cd < project_folder> /
9
+
10
+ cp -r nodock/_examples/rethinkdb/* .
11
+ ```
12
+
13
+ ### Usage
14
+
15
+ ``` bash
16
+ cd nodock/
17
+
18
+ docker-compose up -d node rethinkdb nginx
19
+ ```
20
+
21
+ By going to ` 127.0.0.1 ` in your browser you should be seeing a nice greeting!
22
+
23
+ You can access the RethinkDB GUI via ` 127.0.0.1:28080 ` .
Original file line number Diff line number Diff line change
1
+ var express = require ( 'express' ) ;
2
+ var app = express ( ) ;
3
+ var r = require ( 'rethinkdb' ) ;
4
+
5
+ app . get ( '/' , function ( req , res ) {
6
+ r . connect ( {
7
+ host : 'rethinkdb' ,
8
+ port : 28015 ,
9
+ authKey : '' ,
10
+ } , function ( err ) {
11
+
12
+ if ( ! err ) {
13
+ res . send ( 'You are amazing' ) ;
14
+ } else {
15
+ res . send ( 'Could not connect to RethinkDB :(' ) ;
16
+ }
17
+
18
+ } ) ;
19
+ } ) ;
20
+
21
+ app . listen ( 8000 ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " example-rethinkdb-node-docker" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " " ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "author" : " " ,
10
+ "license" : " MIT" ,
11
+ "dependencies" : {
12
+ "express" : " ^4.14.0" ,
13
+ "rethinkdb" : " ^2.3.3"
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -90,6 +90,17 @@ services:
90
90
expose :
91
91
- " 11211"
92
92
93
+ rethinkdb :
94
+ build :
95
+ context : ./rethinkdb
96
+ volumes :
97
+ - ./data/rethinkdb:/data
98
+ expose :
99
+ - " 28015"
100
+ - " 29015"
101
+ ports :
102
+ - " 28080:8080"
103
+
93
104
volumes :
94
105
image : tianon/true
95
106
volumes :
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ ENV NODE_ENV=$NODE_ENV
17
17
RUN groupadd -r www-app &&\
18
18
useradd -r -g www-app www-app
19
19
20
+ RUN mkdir -p /home/www-app &&\
21
+ chmod 777 /home/www-app -R
22
+
20
23
# Install the specified NODE_VERSION or grab latest
21
24
RUN n "$NODE_VERSION"
22
25
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ cd $PROJECT_PATH
13
13
if [[ $YARN = true ]]; then
14
14
su -c " cd $PROJECT_PATH ; yarn" -s /bin/bash www-app
15
15
else
16
- su -c " cd $PROJECT_PATH ; npm i" -s /bin/bash www-app
16
+ su -c " cd $PROJECT_PATH ; npm i --force " -s /bin/bash www-app
17
17
fi
18
18
19
19
su -c " cd $PROJECT_PATH ; $SCRIPT " -s /bin/bash www-app
Original file line number Diff line number Diff line change
1
+ FROM rethinkdb
2
+
3
+ CMD ["rethinkdb" , "--bind" , "all" ]
You can’t perform that action at this time.
0 commit comments