feat: LokiDeploy 初始提交 - 轻量级 K8s Loki 部署平台
Go(Gin) + React(Vite + shadcn/ui + Tailwind) 前后端分离,全中文 UI - 集群管理:Kubeconfig / Token 双接入,kubectl + helm 部署 - 主机管理:SSH 密钥 / 密码双认证,CPU/内存/磁盘使用率监控,SSH 错误中文友好提示 - 存储配置、部署管理、系统设置 - Docker 镜像内置 kubectl + helm,开箱即用 - run.sh 一键启停(start/stop/restart/status) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
commit
2a93de600d
134 files changed
+19595
No files matched your search
+53
@@ -0,0 +1,53 @@
|
||||
# Build stage - Frontend
|
||||
FROM node:20-alpine AS frontend-builder
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Build stage - Backend
|
||||
FROM golang:1.24-alpine AS backend-builder
|
||||
RUN apk add --no-cache git ca-certificates
|
||||
ENV GOTOOLCHAIN=local
|
||||
WORKDIR /app/backend
|
||||
COPY backend/go.* ./
|
||||
RUN go mod download
|
||||
COPY backend/ ./
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bin/lokideploy .
|
||||
|
||||
# Final stage - 内置 kubectl + helm,部署开箱即用
|
||||
FROM alpine:3.19
|
||||
RUN apk --no-cache add ca-certificates openssh-client curl bash
|
||||
ARG TARGETARCH=amd64
|
||||
# 安装 kubectl(兼容大多数集群版本,±1 版本原则)
|
||||
RUN curl -fsSL -o /usr/local/bin/kubectl \
|
||||
"https://dl.k8s.io/release/v1.31.0/bin/linux/${TARGETARCH}/kubectl" \
|
||||
&& chmod +x /usr/local/bin/kubectl
|
||||
# 安装 helm
|
||||
RUN mkdir -p /tmp/helm \
|
||||
&& curl -fsSL "https://get.helm.sh/helm-v3.16.3-linux-${TARGETARCH}.tar.gz" \
|
||||
| tar -xz -C /tmp/helm \
|
||||
&& mv "/tmp/helm/linux-${TARGETARCH}/helm" /usr/local/bin/helm \
|
||||
&& chmod +x /usr/local/bin/helm \
|
||||
&& rm -rf /tmp/helm
|
||||
WORKDIR /app
|
||||
|
||||
# Copy frontend build
|
||||
COPY --from=frontend-builder /app/frontend/dist ./dist
|
||||
|
||||
# Copy backend binary
|
||||
COPY --from=backend-builder /app/backend/bin/lokideploy ./lokideploy
|
||||
RUN chmod +x ./lokideploy
|
||||
|
||||
# Create data directory
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Environment
|
||||
ENV DATA_DIR=/app/data
|
||||
ENV SERVER_PORT=8080
|
||||
ENV JWT_SECRET=lokideploy-secret-key-change-in-production
|
||||
EXPOSE 8080
|
||||
|
||||
# Serve frontend as static files
|
||||
CMD ["./lokideploy"]
|
||||
Reference in new issue
Block a user