feat: enhance evobgp with new command-line tools for bundle management, including pull, verify, and apply functionalities. Update go.mod to include necessary dependencies and complete todos in architecture plan for improved observability and deployment practices.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# BIRD 2 alongside evobgp-agent; share /etc/bird with the agent container (plan §4.1).
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends bird2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY deploy/bird/bird.conf /etc/bird/bird.conf
|
||||
RUN mkdir -p /etc/bird/bird.d
|
||||
EXPOSE 179
|
||||
# Foreground for Docker; configs on shared volume override this file at runtime.
|
||||
CMD ["bird", "-f", "-c", "/etc/bird/bird.conf"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# evobgp-agent CLI (parse-check, birdc configure); install bird2 so `bird -p` matches bird2 image (plan §13).
|
||||
FROM golang:1.22-bookworm AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
COPY . .
|
||||
RUN go build -trimpath -ldflags="-s -w" -o /out/evobgp-agent ./cmd/evobgp-agent
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends bird2 ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /out/evobgp-agent /usr/local/bin/evobgp-agent
|
||||
WORKDIR /etc/bird
|
||||
ENTRYPOINT ["/usr/local/bin/evobgp-agent"]
|
||||
@@ -0,0 +1,11 @@
|
||||
# Статическая панель EvoBGP (SvelteKit) + nginx как reverse-proxy к evobgp-api (/v1, /metrics).
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /web
|
||||
COPY web/package.json web/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY web/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
COPY deploy/docker/evobgp-web/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /web/build /usr/share/nginx/html
|
||||
@@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
gzip on;
|
||||
gzip_types text/css application/javascript application/json image/svg+xml;
|
||||
|
||||
location /v1/ {
|
||||
proxy_pass http://evobgp-api:8080/v1/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location = /metrics {
|
||||
proxy_pass http://evobgp-api:8080/metrics;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
# Универсальная сборка бинаря из cmd/* (ARG BIN=evobgp-api | evobgp-all).
|
||||
# INSTALL_BIRDC=1 ставит bird2 в рантайм-образ для EVOBGP_BIRDC_SOCKET (poll метрик birdc).
|
||||
FROM golang:1.22-bookworm AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
ARG BIN=evobgp-api
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/evobgp ./cmd/${BIN}
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
ARG INSTALL_BIRDC=0
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& if [ "$INSTALL_BIRDC" = "1" ]; then apt-get install -y --no-install-recommends bird2; fi \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /out/evobgp /usr/local/bin/evobgp
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["/usr/local/bin/evobgp"]
|
||||
Reference in New Issue
Block a user