Skip to content

Using docker compose #44

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

Merged
merged 4 commits into from
Nov 30, 2015
Merged
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
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ machine:

dependencies:
pre:
- docker pull plotly/imageserver:1.0.0
- docker pull plotly/imageserver:latest
post:
- npm run cibuild
- docker run -d --name myimageserver -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/imageserver:1.0.0; sleep 20
- docker run -d --name myimageserver -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/imageserver:latest; sleep 20

test:
override:
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# For installing docker-compose, please refer page
# https://docs.docker.com/compose/install/
# For using docker compose
# 1. start docker container, like vagrant, go under folder
# contains docker-compose.yml file and run:
# $ docker-compose up -d
# 2. stop the container
# $ docker-compose stop
# 3. remove the container
# $ docker-compose rm -f


dev:
container_name: imagetest
image: plotly/imageserver:latest
volumes:
- .:/var/www/streambed/image_server/plotly.js
ports:
- "9010:9010"
- "2022:22"
27 changes: 16 additions & 11 deletions test/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

Test plotly.js with the Plotly Image-Server docker container.

### Run the container

### Run the container with `docker compose`

Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of testing docker container,
please refer [installing docker-compose](https://docs.docker.com/compose/install/) for installation.
Inside your `plotly.js` directory, run

```bash
docker run -d --name imagetest \
-v $PWD:/var/www/streambed/image_server/plotly.js \
-p 9010:9010 -p 2022:22 plotly/imageserver:[version]
$ docker-compose up -d
```

where `[version]` is the latest Plotly Image-Server docker container version
as listed on
[hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
In the `docker-compose.yml` file, `latest` is the latest Plotly Image-Server docker container version
as listed on [hub.docker.com](https://hub.docker.com/r/plotly/imageserver/tags/) and
`imagetest` is the name of the docker container.


### Run the tests

Inside your `plotly.js` directory, run
Expand Down Expand Up @@ -70,16 +71,20 @@ docker images
docker ps -a
```

### Stop container
### Stop your testing container

Inside your `plotly.js` directory, run

```bash
docker stop [container_id]
docker-compose stop
```

### Remove container
### Remove your testing container

Inside your `plotly.js` directory, run

```bash
docker rm [container_id]
docker-compose rm -f
```

For more comprehensive information about docker, please refer to [docker document](http://docs.docker.com/)