mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-15 15:59:03 +00:00
Build fix #7
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user