Initial Commit
This commit is contained in:
30
Dockerfile
Normal file
30
Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user