muyu-apiserver/deploy/Dockerfile.inventory

16 lines
444 B
Docker
Raw Normal View History

FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server ./rpc/inventory/inventory.go
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /server ./inventory
COPY deploy/etc/inventory.yaml etc/inventory.yaml
EXPOSE 9002
CMD ["./inventory", "-f", "etc/inventory.yaml"]