This commit is contained in:
2020-06-25 18:24:00 -04:00
parent bf0b4a6509
commit 24c6701b01
3 changed files with 2003 additions and 2716 deletions

View File

@@ -1,20 +1,21 @@
# Build API
FROM golang:1.13 as go_build
WORKDIR /go/src/github.com/simon987/task_tracker/
FROM golang:1.14 as go_build
WORKDIR /build/
COPY .git .git
COPY api api
COPY client client
COPY config config
COPY main main
COPY storage storage
RUN go get ./main/ && GOOS=linux CGO_ENABLED=0 go build -a -installsuffix cgo -o tt_api ./main/
COPY go.mod .
RUN GOOS=linux CGO_ENABLED=0 go build -a -installsuffix cgo -o tt_api ./main/
FROM scratch
WORKDIR /root/
COPY --from=go_build ["/go/src/github.com/simon987/task_tracker/tt_api", "/root/"]
COPY --from=go_build ["/build/tt_api", "/root/"]
COPY ["config.yml", "schema.sql", "/root/"]
CMD ["/root/tt_api"]