From 5f8da8faefdc1d52d5a07f801f6737eb2afc35ab Mon Sep 17 00:00:00 2001 From: nutcas3 Date: Wed, 29 Apr 2026 02:43:49 +0300 Subject: [PATCH] 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 --- deployments/docker/cli.Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 deployments/docker/cli.Dockerfile diff --git a/deployments/docker/cli.Dockerfile b/deployments/docker/cli.Dockerfile new file mode 100644 index 0000000..ff39fc6 --- /dev/null +++ b/deployments/docker/cli.Dockerfile @@ -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"]