go-guerrilla icon indicating copy to clipboard operation
go-guerrilla copied to clipboard

Dockerfile

Open petzsch opened this issue 6 years ago • 2 comments

I thought it would be cool to have a Dockerfile for this project.

I've rudimentarily made one. Perhaps someone can find it useful and make a more generic version of it for general use? Just leaving this here as a snippet.

FROM golang AS builder
WORKDIR /source
RUN curl https://glide.sh/get | sh
RUN apt-get update && apt-get install -y git
RUN go get github.com/flashmob/go-guerrilla
RUN cd /go/src/github.com/flashmob/go-guerrilla && glide install && make guerrillad
RUN mkdir /app && cp /go/src/github.com/flashmob/go-guerrilla/guerrillad /app/ && cp /go/src/github.com/flashmob/go-guerrilla/goguerrilla.conf.sample /app/goguerrilla.conf.json

FROM alpine

RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

WORKDIR /app

COPY --from=builder "/app" .

RUN mkdir /config

VOLUME /config

CMD ["/app/guerrillad", "serve", "-c", "/config/goguerrilla.conf.json"]

The docker image assumes that you have a volume mounted under /config/ which you use to store your configuration file and perhaps ssl/tls certs.

petzsch avatar Dec 16 '18 17:12 petzsch

Thanks for this! Nice X-mas present 😀

Will add this to the wiki.

flashmob avatar Dec 18 '18 23:12 flashmob

I think, now need to install dep instead of glide, right?

cd $GOPATH/src/github.com/flashmob/go-guerrilla
go get -u github.com/golang/dep/cmd/dep
dep ensure

?

lord-alfred avatar Jul 31 '19 21:07 lord-alfred