Initial Commit

This commit is contained in:
2026-04-15 19:09:21 +03:00
commit c2572c5702
15 changed files with 1587 additions and 0 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM golang:1.23-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/cpu-benchmark-server .
FROM alpine:3.21
WORKDIR /app
RUN apk add --no-cache ca-certificates
COPY --from=builder /out/cpu-benchmark-server /app/cpu-benchmark-server
COPY templates /app/templates
COPY example_jsons /app/example_jsons
ENV APP_ADDR=:8080
ENV BADGER_DIR=/data/badger
ENV PAGE_SIZE=50
ENV SHUTDOWN_TIMEOUT=10s
VOLUME ["/data"]
EXPOSE 8080
ENTRYPOINT ["/app/cpu-benchmark-server"]