Files
next.orly.dev/cmd/benchmark/Dockerfile.benchmark
mleku e521b788fb Delete outdated benchmark reports and results.
Removed old benchmark reports and detailed logs from the repository to clean up unnecessary files. These reports appear to be auto-generated and no longer relevant for ongoing development.
2025-09-15 05:00:19 +01:00

51 lines
1.1 KiB
Docker

# Dockerfile for benchmark runner
FROM golang:1.25-alpine AS builder
# Install build dependencies
RUN apk add --no-cache git ca-certificates
# Set working directory
WORKDIR /build
# Copy go modules
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the benchmark tool
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o benchmark cmd/benchmark/main.go
# Final stage
FROM alpine:latest
# Install runtime dependencies
RUN apk --no-cache add ca-certificates curl wget
WORKDIR /app
# Copy benchmark binary
COPY --from=builder /build/benchmark /app/benchmark
# Copy benchmark runner script
COPY cmd/benchmark/benchmark-runner.sh /app/benchmark-runner
# Make scripts executable
RUN chmod +x /app/benchmark-runner
# Create runtime user and reports directory owned by uid 1000
RUN adduser -u 1000 -D appuser && \
mkdir -p /reports && \
chown -R 1000:1000 /app /reports
# Environment variables
ENV BENCHMARK_EVENTS=10000
ENV BENCHMARK_WORKERS=8
ENV BENCHMARK_DURATION=60s
# Drop privileges: run as uid 1000
USER 1000:1000
# Run the benchmark runner
CMD ["/app/benchmark-runner"]