Unverified Commit 4096b336 authored by Isuru Liyanage's avatar Isuru Liyanage Committed by GitHub
Browse files

Merge pull request #12 from elixir-europe/docker-integration

add correct dockerfile and start script
parents 295a0a85 8c9b163f
Pipeline #149473 failed with stage
in 35 seconds
FROM node:carbon
FROM node:12.22.0-buster
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
COPY ./start.sh /
RUN npm install
# Bundle app source
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]
\ No newline at end of file
ENTRYPOINT ["/start.sh"]
\ No newline at end of file
......@@ -371,6 +371,23 @@ JSON object:
}
```
## Running in Docker
Dockerized version of BioValidator is available in [quay.io](https://quay.io/repository/ebi-ait/biovalidator).
These images can be used to run the validator without cloning this repository.
Pull docker image from [quay.io](https://quay.io/repository/ebi-ait/biovalidator)
```shell
docker pull quay.io/ebi-ait/biovalidator:1.0.0
```
Run in server mode
```shell
docker run -p 3020:3020 -d quay.io/ebi-ait/biovalidator:1.0.0 --server
```
Run in onetime mode
```shell
docker run quay.io/ebi-ait/biovalidator:1.0.0 --schema /path/to/schema.json --json /path/to/json.json
```
## License
For more details about licensing see the [LICENSE](LICENSE.md).
{
"name": "json-schema-validator",
"version": "1.8.0",
"name": "biovalidator",
"version": "1.9.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "json-schema-validator",
"version": "1.8.0",
"name": "biovalidator",
"version": "1.9.0",
"description": "A nodejs JSON schema validator service.",
"main": "src/server.js",
"repository": "https://github.com/EMBL-EBI-SUBS/json-schema-validator.git",
"repository": "https://github.com/elixir-europe/biovalidator.git",
"scripts": {
"start": "node src/server.js",
"test": "jest",
......
#!/bin/bash
server=false
while [ $# -gt 0 ]; do
case "$1" in
--server)
server=true
;;
--schema)
schema="$2"
shift
;;
--json)
json="$2"
shift
;;
*)
printf "*********************************************************************************\n"
printf "* Error, invalid arguments. Valid arguments are \n"
printf "* --server to run in server mode\n"
printf "* --schema /path/to/schema --json /path/to/json to validate json against schema \n"
printf "*********************************************************************************\n"
exit 1
esac
shift
done
if [ $server = true ]
then
printf "Running validator in server mode \n"
node src/server.js
else
printf "Running validator in onetime validation mode with params schema=%s json=%s \n" "$schema" "$json"
node validator-cli.js --schema="$schema" --json="$json"
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment