Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed docker container issue and added docker-compose file to simplify config #70

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 2 additions & 21 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
3 changes: 3 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm install
npm install es6-promise
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it would be better to add this to package.json

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of that but this would affect the application itself. I couldn't see any issue regarding using installable application (without docker) so thought it could be an issue with docker setup (like missing some libs in setup).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding es6-promise resolved #62 because it is a dependency of this app from what I can tell. An npm install mockbin on a blank system yields the same error as the Docker build

npm start