feat(ui): Add React based UI for the vibes at /app
This adds a completely separate frontend based on React because I found that code gen works better with React once the application gets bigger. In particular it was getting very hard to move past add connectors and actions. The idea is to replace the standard UI with this once it has been tested. But for now it is available at /app in addition to the original at / Signed-off-by: Richard Palethorpe <io@richiejp.com>
This commit is contained in:
@@ -1,6 +1,24 @@
|
||||
# Define argument for linker flags
|
||||
ARG LDFLAGS=-s -w
|
||||
|
||||
# Use Bun container for building the React UI
|
||||
FROM oven/bun:1 as ui-builder
|
||||
|
||||
# Set the working directory for the React UI
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package.json and bun.lockb (if exists)
|
||||
COPY webui/react-ui/package.json webui/react-ui/bun.lockb* ./
|
||||
|
||||
# Install dependencies
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy the rest of the React UI source code
|
||||
COPY webui/react-ui/ ./
|
||||
|
||||
# Build the React UI
|
||||
RUN bun run build
|
||||
|
||||
# Use a temporary build image based on Golang 1.22-alpine
|
||||
FROM golang:1.22-alpine as builder
|
||||
|
||||
@@ -23,6 +41,9 @@ RUN go mod download
|
||||
# Now copy the rest of the source code
|
||||
COPY . .
|
||||
|
||||
# Copy the built React UI from the ui-builder stage
|
||||
COPY --from=ui-builder /app/dist /work/webui/react-ui/dist
|
||||
|
||||
# Build the application
|
||||
RUN go build -ldflags="$LDFLAGS" -o localagent ./
|
||||
|
||||
@@ -33,6 +54,5 @@ COPY --from=builder /work/localagent /localagent
|
||||
COPY --from=builder /etc/ssl/ /etc/ssl/
|
||||
COPY --from=builder /tmp /tmp
|
||||
|
||||
|
||||
# Define the command that will be run when the container is started
|
||||
ENTRYPOINT ["/localagent"]
|
||||
|
||||
Reference in New Issue
Block a user