Skip to content

Commit c88fb5a

Browse files
committed
Merge pull request #44 from plotly/using_docker_compose
Using docker compose
2 parents e210f41 + 5737807 commit c88fb5a

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

circle.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ machine:
1212

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

2020
test:
2121
override:

docker-compose.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# For installing docker-compose, please refer page
3+
# https://docs.docker.com/compose/install/
4+
# For using docker compose
5+
# 1. start docker container, like vagrant, go under folder
6+
# contains docker-compose.yml file and run:
7+
# $ docker-compose up -d
8+
# 2. stop the container
9+
# $ docker-compose stop
10+
# 3. remove the container
11+
# $ docker-compose rm -f
12+
13+
14+
dev:
15+
container_name: imagetest
16+
image: plotly/imageserver:latest
17+
volumes:
18+
- .:/var/www/streambed/image_server/plotly.js
19+
ports:
20+
- "9010:9010"
21+
- "2022:22"

test/image/README.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22

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

5-
### Run the container
65

6+
### Run the container with `docker compose`
7+
8+
Plotly.js uses `docker-compose` to ease the creation/stopping/deletion of testing docker container,
9+
please refer [installing docker-compose](https://docs.docker.com/compose/install/) for installation.
710
Inside your `plotly.js` directory, run
811

912
```bash
10-
docker run -d --name imagetest \
11-
-v $PWD:/var/www/streambed/image_server/plotly.js \
12-
-p 9010:9010 -p 2022:22 plotly/imageserver:[version]
13+
$ docker-compose up -d
1314
```
1415

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

20+
2021
### Run the tests
2122

2223
Inside your `plotly.js` directory, run
@@ -70,16 +71,20 @@ docker images
7071
docker ps -a
7172
```
7273

73-
### Stop container
74+
### Stop your testing container
75+
76+
Inside your `plotly.js` directory, run
7477

7578
```bash
76-
docker stop [container_id]
79+
docker-compose stop
7780
```
7881

79-
### Remove container
82+
### Remove your testing container
83+
84+
Inside your `plotly.js` directory, run
8085

8186
```bash
82-
docker rm [container_id]
87+
docker-compose rm -f
8388
```
8489

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

0 commit comments

Comments
 (0)