-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (18 loc) · 813 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
##URL DE EXEMPLO: https://blog.golang.org/docker
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang AS builder
# Go dep!
RUN go get -u github.com/golang/dep/...
# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/alefcarlos/calculator-echo
WORKDIR /go/src/github.com/alefcarlos/calculator-echo
RUN dep ensure
# Build the calculator-service command inside the container.
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/calculator-echo -v github.com/alefcarlos/calculator-echo/src/cmd/webapi
FROM scratch
# Copiar arquivo .env específico para o docker
#COPY docker.env .env
# Copiar arquivo binário
COPY --from=builder /bin/calculator-echo calculator-echo
CMD [ "./calculator-echo" ]