2026-06-14 12:38:46 +08:00
|
|
|
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
|
2026-02-28 15:29:16 +08:00
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
|
WORKDIR /app
|
2026-06-14 12:38:46 +08:00
|
|
|
COPY --from=builder /server ./inventory
|
2026-02-28 15:29:16 +08:00
|
|
|
COPY deploy/etc/inventory.yaml etc/inventory.yaml
|
|
|
|
|
EXPOSE 9002
|
|
|
|
|
CMD ["./inventory", "-f", "etc/inventory.yaml"]
|