-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 725 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 725 Bytes
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
31
FROM golang:1.17-alpine as builder
ENV GO111MODULE=on
WORKDIR /app
COPY go.mod go.sum ./
RUN go install github.com/cespare/reflex@latest
RUN go mod download
COPY openapi/ openapi/
COPY cmd/ cmd/
COPY src/ src/
ENV CGO_ENABLED 0
RUN GOOS=linux GOARCH=amd64 go build \
-ldflags='-w -s -extldflags "-static"' -a \
-o /app/queue_server cmd/main.go
FROM gcr.io/distroless/static as production
COPY --from=builder /app/queue_server /
ENTRYPOINT ["/queue_server"]
FROM golang:1.17-alpine as development
ENV CGO_ENABLED 0
COPY --from=builder /app/queue_server /
WORKDIR /app
COPY --from=builder /go/bin/reflex /usr/bin/reflex
ENTRYPOINT ["reflex", "-sr", ".*(\\.yaml|\\.go)$$", "--", "go", "run", "cmd/main.go"]