Files
managed-portal/Dockerfile
skye.yue ea618fd674 Refactor store dwell alert management API and dwell engine
- Updated argument parsing in manage_api.py to include new threshold parameters.
- Enhanced _config_payload to include thresholds and webhook configurations.
- Modified _build_summary to track queue metrics and adjust alert reporting.
- Refactored DwellEngine to utilize queue thresholds for alerting and reporting.
- Added queue metrics calculations and status change tracking in dwell_engine.py.
- Updated notifier.py to support posting JSON events to webhooks.
- Adjusted example configuration to reflect new threshold parameters.
- Enhanced Docker entrypoint script for better process management.
- Updated tests to cover new queue metrics and thresholds.
- Improved ManagedServiceDetail and ManagedServices Vue components to display queue metrics.
2026-05-09 11:35:55 +08:00

40 lines
1.0 KiB
Docker

FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/golang:1.25.4-alpine AS builder
ENV TZ=Asia/Shanghai \
GOPROXY=https://goproxy.cn,direct \
GOSUMDB=sum.golang.google.cn
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /build
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build \
-a -installsuffix cgo \
-o managed-portal \
./cmd/managed-portal
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/alpine:3.23
ENV TZ=Asia/Shanghai \
MANAGED_PORTAL_HTTP_ADDR=:9080 \
MANAGED_PORTAL_REGISTRY_PATH=/app/managed_services.yaml
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache docker-cli ca-certificates tzdata && \
rm -rf /var/cache/apk/*
WORKDIR /app
COPY --from=builder /build/managed-portal /app/managed-portal
COPY managed_services.yaml /app/managed_services.yaml
EXPOSE 9080
CMD ["/app/managed-portal"]