mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
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:
@@ -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"]
|
||||
Reference in New Issue
Block a user