Saray & Docker
Wrapper of Saray and Nginx as Docker containers (with
docker-compose
)
Docker and docker-compose
must be installed.
- Nginx (official Docker image)
- Ubuntu Xenial (official Docker image)
NodeJs (7.x)
PM2-docker (latest)
Saray (latest)
$ git clone https://github.com/contactlab/saray-docker.git saray-docker && cd $_
$ docker-compose build
The runner for PM2 and Saray should be like the follow and placed within the root
directory of the project, called run.js
:
run.js
const {exec} = require('child_process');
exec(`saray --port=3000 --path=/src/data --endpoint='yourApiEndPoint' --log /src/logs.log --pfer-api`, (error, stdout, stderr) => {
console.log(error);
console.log(stdout);
console.log(stderr);
});
The data
folder with the stubbed APIs should be placed within the root
directory of the project.
NOTE: The
docker-compose.yml
can be modified and re-built as you want.
Simply run docker-compose
:
$ docker-compose up
Now you can check your localhost:3001 and everything should be up and running!
You can also add new stubs into the data
folder.
Run in deamon
mode:
$ docker-compose up -d
Released under the Apache 2.0 license.