This commit is contained in:
Kar
2026-02-01 20:22:29 +05:30
commit 52265ed4cc
30 changed files with 2058 additions and 0 deletions

36
Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Install git for cloning repositories
RUN apk add --no-cache git
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o manager ./cmd/manager
# Final stage
FROM alpine:latest
# Install git and docker client
RUN apk add --no-cache git docker-cli
WORKDIR /root/
# Copy the binary from builder stage
COPY --from=builder /app/manager .
# Copy manifests
COPY --from=builder /app/manifests ./manifests
# Expose port
EXPOSE 8080
# Run the application
CMD ["./manager"]