diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a8801536 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +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" + environment: + MOCKBIN_REDIS: redis://mockbinredis:6379 diff --git a/docs/install.md b/docs/install.md index 937f589f..d1b64d49 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. diff --git a/run.sh b/run.sh new file mode 100644 index 00000000..11a0d574 --- /dev/null +++ b/run.sh @@ -0,0 +1,3 @@ +npm install +npm install es6-promise +npm start