From d3782a9e012f499f3e2a09d3242270d6cd38473a Mon Sep 17 00:00:00 2001 From: Alessandro Sebastiani Date: Thu, 8 Aug 2019 11:39:06 +0200 Subject: [PATCH] docker support --- Dockerfile | 10 ++++++++++ README.md | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0414af0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.12.6 + +WORKDIR /go/src/pc-web-validator +COPY ./src/ . + +RUN go get -d -v ./... +RUN go install -v ./... +RUN go build -o main + +CMD ["./main"] \ No newline at end of file diff --git a/README.md b/README.md index 9c69d9b..6aac323 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,14 @@ $ curl -XPOST localhost:5000/pc/validate -d '{ "publiccodeYmlVersion": "0.2" }' ``` +## Docker support + +This project can be packaged and executed using Docker as follow: + +```sh +$ docker build -t pc-web-validator . +$ docker run -p5000:5000 --name pc-web-validator -it --rm pc-web-validator +``` ## Contributing