aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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