39 lines
643 B
Docker
39 lines
643 B
Docker
# UI build stage
|
|
FROM node:alpine AS ui-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY otel-ui/ .
|
|
|
|
RUN npm install && npm run build
|
|
|
|
# Go build stage
|
|
FROM golang:1.25-alpine AS go-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY cmd/ ./cmd
|
|
COPY internal/ ./internal
|
|
|
|
# Copy built UI dist
|
|
COPY --from=ui-builder /app/dist ./otel-ui/dist
|
|
|
|
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=go-builder /go-otel .
|
|
COPY --from=go-builder /app/otel-ui/dist ./dist
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["./go-otel"]
|