aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-10-20 05:12:00 +0530
committerBobby <[email protected]>2025-10-20 05:12:00 +0530
commit5c004873a7929ab8cf38eb764ed02df9f726329e (patch)
treedcacc88bd6f7b0153657188c6ec00ece13654649
parent8700e3adb54677cf10703d46820517353d5d84e4 (diff)
downloadcomplexity-analyzer-5c004873a7929ab8cf38eb764ed02df9f726329e.tar.xz
complexity-analyzer-5c004873a7929ab8cf38eb764ed02df9f726329e.zip
added dockerfile for build
-rw-r--r--Dockerfile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..a8c9759
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,25 @@
+FROM golang:1.24 AS builder
+
+WORKDIR /complexity-analyzer
+
+RUN apt-get update && apt-get install -y gcc libc6-dev make git
+
+ENV CGO_ENABLED=1
+
+COPY go.mod go.sum* ./
+RUN go mod download
+
+COPY . .
+RUN go build -o complexity-analyzer
+
+FROM debian:bookworm-slim
+
+WORKDIR /complexity-analyzer
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends ca-certificates tzdata && rm -rf /var/lib/apt/lists/*
+
+COPY --from=builder /complexity-analyzer/complexity-analyzer .
+
+CMD ["./complexity-analyzer"] \ No newline at end of file