Dockerized
This commit is contained in:
parent
53a2ece83a
commit
407261b654
14
Dockerfile.app
Normal file
14
Dockerfile.app
Normal 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
24
Dockerfile.builder
Normal 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/
|
@ -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())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user