now with websockets

This commit is contained in:
Para Dox
2025-05-01 14:17:45 +07:00
parent ae1cbd0493
commit 25502ae1a1

View File

@@ -1,16 +1,27 @@
FROM golang:1.21-alpine as builder # Build stage
FROM golang:1.21-alpine AS builder
WORKDIR /app WORKDIR /app
# Initialize Go modules if not already done
RUN go mod init benchmark-proxy
# Add the dependency before building
RUN go get github.com/gorilla/websocket
# Copy source code
COPY . . COPY . .
# Build with optimization flags # Build the application with CGO disabled for a static binary
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o benchmark-proxy main.go RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o benchmark-proxy main.go
FROM alpine:3.18 # Runtime stage (if you're using a multi-stage build)
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app WORKDIR /app
# Copy the binary from the build stage
COPY --from=builder /app/benchmark-proxy . COPY --from=builder /app/benchmark-proxy .
EXPOSE 8080 # Run the application
CMD ["./benchmark-proxy"] ENTRYPOINT ["./benchmark-proxy"]