File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed
Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 11# Start by building the application.
2- FROM golang:1.24-bookworm AS build
2+ FROM node:22-alpine AS build-web
3+ WORKDIR /app
4+ COPY . .
5+ RUN npm install
6+ RUN npm run build
37
8+ FROM golang:1.24-alpine AS build
49WORKDIR /go/src/kuview
510COPY . .
11+ COPY --from=build-web /app/dist /go/src/kuview/dist
612
713ENV CGO_ENABLED=0
8- RUN go build -o /go/bin/kuview cmd/server/main.go
14+ RUN go build -v -o /go/bin/kuview cmd/server/main.go
15+
916
10- FROM node:22-alpine AS build-web
11- WORKDIR /app
12- COPY . .
13- RUN npm install
14- RUN npm run build
1517
1618# Now copy it into our base image.
1719FROM gcr.io/distroless/static-debian12
1820WORKDIR /app
1921COPY --from=build /go/bin/kuview /app/kuview
20- COPY --from=build-web /app/dist /app/dist
2122
2223EXPOSE 8001
2324CMD ["/app/kuview" ]
Original file line number Diff line number Diff line change 66 "net/http"
77 "sync"
88
9+ "github.com/iwanhae/kuview"
910 "github.com/iwanhae/kuview/pkg/controller"
1011 "github.com/iwanhae/kuview/pkg/server/middleware"
1112 "github.com/labstack/echo/v4"
@@ -62,8 +63,10 @@ func New(cfg *rest.Config) (*Server, error) {
6263 },
6364 }))
6465 static .Use (echomiddleware .StaticWithConfig (echomiddleware.StaticConfig {
65- Root : "dist" ,
66- HTML5 : true ,
66+ Root : "dist" ,
67+ HTML5 : true ,
68+ Browse : true ,
69+ Filesystem : http .FS (kuview .DistFS ),
6770 }))
6871
6972 s .Use (middleware .RequestID ())
Original file line number Diff line number Diff line change 1+ package kuview
2+
3+ import "embed"
4+
5+ //go:embed dist
6+ var DistFS embed.FS
You can’t perform that action at this time.
0 commit comments