Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Dec 14, 2020
1 parent c01f878 commit 7469ba3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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
# RUN GOPATH=$PWD/.mod go install ./cmd/bbgo
RUN go install ./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"]
# vim:filetype=dockerfile:

0 comments on commit 7469ba3

Please sign in to comment.