Files
LocalAGI/Dockerfile.webui
T
Ettore Di Giacinto bc567ef7dd feat(skills): add skills management (#423)
* feat(skills): add skills management

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* improve ui

* Update webui/skills_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update webui/skills_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update webui/skills_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update webui/skills_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Dockerfile.webui

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update go.mod

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update webui/skills_handlers.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Address feedback from review

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* Fixups

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* allow to customize skill prompt

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* Fixups

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-21 22:21:33 +01:00

65 lines
1.5 KiB
Docker

# 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.26-alpine
FROM golang:1.26-alpine AS builder
# Define argument for linker flags
ARG LDFLAGS="-s -w"
# Install git
RUN apk add --no-cache git
RUN rm -rf /tmp/* /var/cache/apk/*
# Set the working directory
WORKDIR /work
# Copy go.mod and go.sum files first to leverage Docker cache
COPY go.mod go.sum ./
# Download dependencies - this layer will be cached as long as go.mod and go.sum don't change
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 CGO_ENABLED=0 go build -ldflags="$LDFLAGS" -o localagi ./
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
tzdata \
docker.io \
bash \
wget \
curl
# Copy the webui binary from the builder stage to the final image
COPY --from=builder /work/localagi /localagi
# Define the command that will be run when the container is started
ENTRYPOINT ["/localagi"]