This commit is contained in:
2025-11-13 19:35:48 +01:00
parent c3b62a3a95
commit 4eb8dc39a6
8 changed files with 41 additions and 359 deletions
+19 -6
View File
@@ -1,12 +1,25 @@
# Build stage
FROM golang:1.25-alpine AS builder
# 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 . .
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
@@ -17,9 +30,9 @@ RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go-otel .
COPY --from=builder /app/index.html .
COPY --from=go-builder /go-otel .
COPY --from=go-builder /app/otel-ui/dist ./dist
EXPOSE 8080
CMD ["./go-otel"]
CMD ["./go-otel"]