diff --git a/circle.yml b/circle.yml index 9faa311f358..a9a93cf0840 100644 --- a/circle.yml +++ b/circle.yml @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..c65bde79315 --- /dev/null +++ b/docker-compose.yml @@ -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" \ No newline at end of file diff --git a/test/image/README.md b/test/image/README.md index 2c4f45d8470..a8afc9861cf 100644 --- a/test/image/README.md +++ b/test/image/README.md @@ -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 @@ -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/)