-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (25 loc) · 901 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# First stage container
FROM golang:1.15-alpine3.12 AS builder
RUN apk add --no-cache git ca-certificates gcc libc-dev pkgconfig
# gcc is for github.com/mattn/go-sqlite3
RUN go get -u github.com/c9s/goose/cmd/goose
# ADD . $GOPATH/src/github.com/c9s/bbgo
# WORKDIR $GOPATH/src/github.com/c9s/bbgo
WORKDIR $GOPATH/src/github.com/c9s/bbgo
ARG GO_MOD_CACHE
ENV WORKDIR=$GOPATH/src/github.com/c9s/bbgo
ENV GOPATH_ORIG=$GOPATH
ENV GOPATH=${GO_MOD_CACHE:+$WORKDIR/$GO_MOD_CACHE}
ENV GOPATH=${GOPATH:-$GOPATH_ORIG}
ADD . .
RUN go build -o $GOPATH_ORIG/bin/bbgo ./cmd/bbgo
# Second stage container
FROM alpine:3.12
# RUN apk add --no-cache ca-certificates
RUN mkdir /app
WORKDIR /app
COPY --from=builder /go/bin/goose /usr/local/bin
COPY --from=builder /go/bin/bbgo /usr/local/bin
ENTRYPOINT ["/usr/local/bin/bbgo"]
CMD ["run", "--config", "/config/bbgo.yaml", "--no-compile"]
# vim:filetype=dockerfile: