feat: Add Dockerfile for CLI component

- Create multi-stage Dockerfile for CLI application
- Use golang:1.26-alpine as builder image
- Copy go.mod and go.sum for dependency caching
- Build static binary with CGO_ENABLED=0
- Use alpine:latest as runtime image with ca-certificates
- Set /root/ as working directory and ./cli as default command
This commit is contained in:
nutcas3
2026-04-29 02:43:49 +03:00
parent 4e5ad491ef
commit 5f8da8faef
+20
View File
@@ -0,0 +1,20 @@
FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY apps/cli/go.mod apps/cli/go.sum ./
RUN go mod download
COPY apps/cli/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -o cli .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/cli .
CMD ["./cli"]