-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
32 lines (25 loc) · 643 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
29
30
31
32
FROM golang:1.23-alpine AS builder
# Install git and gcc.
RUN apk add --no-cache git gcc musl-dev
# Setup directory.
WORKDIR /go/src/github.com/googleapis/gapic-showcase
COPY . .
# Compile for Linux.
ENV CGO_ENABLED 0
ENV GOOS linux
ENV GOARCH amd64
# Install showcase.
RUN go get ./...
RUN go build -installsuffix cgo \
-ldflags="-w -s" \
-o /go/bin/gapic-showcase \
./cmd/gapic-showcase
# Start a fresh image, and only copy the built binary.
FROM scratch
COPY --from=builder /go/bin/gapic-showcase /go/bin/gapic-showcase
# Expose ports
EXPOSE 7469
EXPOSE 1337
# Run the server.
ENTRYPOINT ["/go/bin/gapic-showcase"]
CMD ["run"]