Dockerized

This commit is contained in:
Denis Zheleztsov 2017-02-13 18:28:02 +03:00
parent 53a2ece83a
commit 407261b654
3 changed files with 39 additions and 0 deletions

14
Dockerfile.app Normal file
View File

@ -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 <difrex.punk@gmail.com>
ADD out/lessmore /usr/bin
ENTRYPOINT ["lessmore"]

24
Dockerfile.builder Normal file
View File

@ -0,0 +1,24 @@
FROM alpine
MAINTAINER Denis Zheleztsov <difrex.punk@gmail.com>
# 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/

View File

@ -92,5 +92,6 @@ func Serve(listen string, es ESConf) {
ReadTimeout: 15 * time.Second, ReadTimeout: 15 * time.Second,
} }
log.Print("Listening IDEC API on ", listen)
log.Fatal(srv.ListenAndServe()) log.Fatal(srv.ListenAndServe())
} }