From ce5021e259ec827f3495791c927ad8afd58fdad9 Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Mon, 9 Oct 2017 17:27:13 +0100 Subject: [PATCH 1/6] Removed dockerfile, added docker-compose and run.sh to install Promise lib --- docker-compose.yml | 23 +++++++++++++++++++++++ run.sh | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 docker-compose.yml create mode 100644 run.sh diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..3caf5430 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '2' + +services: + + redis: + container_name: mockbinredis + image: redis + ports: + - "6379:6379" + + mockbin: + image: "node:8" + user: "node" + working_dir: /home/node/app + volumes: + - ./:/home/node/app + expose: + - "8080" + ports: + - "8099:8080" + command: "bash run.sh" + links: + - "redis:mockbinredis" diff --git a/run.sh b/run.sh new file mode 100644 index 00000000..cec24f8c --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +npm install +npm install es6-promise +npm config set redis redis://mockbinredis:6379 +npm start \ No newline at end of file From f29a70e811b4ca1bd06d7002755d41541bbbdd12 Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Mon, 9 Oct 2017 17:29:39 +0100 Subject: [PATCH 2/6] Updated docker installation docs --- docs/install.md | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/docs/install.md b/docs/install.md index 937f589f..7b09f7d1 100644 --- a/docs/install.md +++ b/docs/install.md @@ -4,32 +4,13 @@ - [Redis](http://redis.io/) - npm modules *listed in [package.json](package.json)* -## Install from source - -```shell -git clone https://github.com/Mashape/mockbin.git ./mockbin -cd mockbin -``` - -## Install with [npm](https://www.npmjs.com/): - -```shell -npm install mockbin -``` ## Install with [Docker](https://www.docker.com/) ### Building the docker image ```shell -docker build -t mockbin . +docker-compose up -d --build ``` -### Running the docker container - -To run, this image needs to be linked to a Redis container: - -```shell -docker run -d --name mockbin_redis redis -docker run -d -p 8080:8080 --link mockbin_redis:redis mashape/mockbin -``` +### Please note: if you changed redis container name, you will need to update it in `package.json` in config section. \ No newline at end of file From d651c420320e75131012605da84d78fccd849228 Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Mon, 9 Oct 2017 18:09:59 +0100 Subject: [PATCH 3/6] Added env variable to docker-compose to set redis and updated run.sh --- docker-compose.yml | 2 ++ run.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3caf5430..4ae9df80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,3 +21,5 @@ services: command: "bash run.sh" links: - "redis:mockbinredis" + environment: + MOCKBIN_REDIS: redis://mockbinredis:6379 diff --git a/run.sh b/run.sh index cec24f8c..755be482 100644 --- a/run.sh +++ b/run.sh @@ -1,4 +1,5 @@ npm install npm install es6-promise -npm config set redis redis://mockbinredis:6379 +#npm config set redis redis://mockbinredis:6379 +MOCKBIN_REDIS=redis://mockbinredis:6379 npm start \ No newline at end of file From bda9827a119a632d665b4a7055eaecdc25282a6f Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Mon, 9 Oct 2017 18:10:59 +0100 Subject: [PATCH 4/6] removed commented line in run.sh --- run.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/run.sh b/run.sh index 755be482..42ade229 100644 --- a/run.sh +++ b/run.sh @@ -1,5 +1,3 @@ npm install npm install es6-promise -#npm config set redis redis://mockbinredis:6379 -MOCKBIN_REDIS=redis://mockbinredis:6379 npm start \ No newline at end of file From 3b6d5f8a2cdc70626488c597b8755ed1938a3c65 Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Mon, 9 Oct 2017 18:13:40 +0100 Subject: [PATCH 5/6] new line at end of file for run.sh --- run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 42ade229..e1e25071 100644 --- a/run.sh +++ b/run.sh @@ -1,3 +1,4 @@ npm install npm install es6-promise -npm start \ No newline at end of file +npm start + From b51c7479d027147e911e34b88ed608953d5aba53 Mon Sep 17 00:00:00 2001 From: Oras Al-Kubaisi Date: Tue, 10 Oct 2017 10:35:44 +0100 Subject: [PATCH 6/6] Fixing formatting issues --- docker-compose.yml | 2 +- docs/install.md | 2 +- run.sh | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4ae9df80..a8801536 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: image: redis ports: - "6379:6379" - + mockbin: image: "node:8" user: "node" diff --git a/docs/install.md b/docs/install.md index 7b09f7d1..d1b64d49 100644 --- a/docs/install.md +++ b/docs/install.md @@ -13,4 +13,4 @@ docker-compose up -d --build ``` -### Please note: if you changed redis container name, you will need to update it in `package.json` in config section. \ No newline at end of file +### Please note: if you changed redis container name, you will need to update it in `package.json` in config section. diff --git a/run.sh b/run.sh index e1e25071..11a0d574 100644 --- a/run.sh +++ b/run.sh @@ -1,4 +1,3 @@ npm install npm install es6-promise npm start -