docker support

This commit is contained in:
2019-08-09 20:24:58 -04:00
parent 9a4741b7bb
commit e4ea65f8e3
10 changed files with 90 additions and 0 deletions

26
Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM alpine as go_build
RUN apk update
RUN apk upgrade
RUN apk add --update git go gcc g++
WORKDIR /go/src/github.com/simon987/ws_bucket/
ENV GOPATH /go
COPY api api
COPY *.go .
RUN go get . && CGO_ENABLED=1 GOOS=linux go build -a -o ws_bucket .
FROM alpine
WORKDIR /root
COPY --from=go_build ["/go/src/github.com/simon987/ws_bucket/ws_bucket", "./"]
ENV WS_BUCKET_DIALECT=sqlite3
ENV WS_BUCKET_CONNSTR=wsb.db
ENV WS_BUCKET_WORKDIR=/data
ENV WS_BUCKET_LOGLEVEL=info
VOLUME ["/data"]
CMD ["/root/ws_bucket"]