From 407261b6549bbf42a01a815d6938eccce3f0fe2f Mon Sep 17 00:00:00 2001 From: Denis Zheleztsov Date: Mon, 13 Feb 2017 18:28:02 +0300 Subject: [PATCH] Dockerized --- Dockerfile.app | 14 ++++++++++++++ Dockerfile.builder | 24 ++++++++++++++++++++++++ node/api.go | 1 + 3 files changed, 39 insertions(+) create mode 100644 Dockerfile.app create mode 100644 Dockerfile.builder diff --git a/Dockerfile.app b/Dockerfile.app new file mode 100644 index 0000000..a77739f --- /dev/null +++ b/Dockerfile.app @@ -0,0 +1,14 @@ +FROM alpine + +# Usage: +# Required artifact from lessmore_builder in $(pwd)/out/ +# Build: +# docker build -t lessmore -f Dockerfile.app . +# Run: +# docker run -ti -p 15582:15582 lessmore -listen 0.0.0.0:15582 -es http://$ES:9200 -esindex idec -estype idec + +MAINTAINER Denis Zheleztsov + +ADD out/lessmore /usr/bin + +ENTRYPOINT ["lessmore"] diff --git a/Dockerfile.builder b/Dockerfile.builder new file mode 100644 index 0000000..5b36623 --- /dev/null +++ b/Dockerfile.builder @@ -0,0 +1,24 @@ +FROM alpine + +MAINTAINER Denis Zheleztsov + +# Usage: +# Build docker image: +# docker build -t lessmore_builder -f Dockerfile.builder . +# Build binary artifact: +# docker run -ti -v $(pwd)/out:/out/ lessmore_builder + +# Install depends +RUN apk update && apk add git go + +ENV GOPATH /usr + +# Get sources +RUN cd / && git clone https://gitea.difrex.ru/Umbrella/lessmore.git + +# Get go depends +RUN cd /lessmore && go get -t -v ./... || true +RUN cd /lessmore && go get gitea.difrex.ru/Umbrella/fetcher +RUN cd /lessmore && go get gitea.difrex.ru/Umbrella/lessmore + +ENTRYPOINT cd /lessmore && go build && mv lessmore /out/ diff --git a/node/api.go b/node/api.go index 980814e..7fd645d 100644 --- a/node/api.go +++ b/node/api.go @@ -92,5 +92,6 @@ func Serve(listen string, es ESConf) { ReadTimeout: 15 * time.Second, } + log.Print("Listening IDEC API on ", listen) log.Fatal(srv.ListenAndServe()) }