Files
go-otel/Dockerfile
T
2025-11-06 16:25:33 +01:00

25 lines
406 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /go-otel ./cmd/server
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go-otel .
COPY --from=builder /app/index.html .
EXPOSE 8080
CMD ["./go-otel"]