Files
llama-link/deploy/Dockerfile
T
darroyo 4c9ed3c24b Initial commit: LlamaLink Go rewrite
Complete rewrite from Python/FastAPI to Go/Gin:
- Go backend: auth (API keys + bcrypt), llama.cpp subprocess manager,
  hot-swap multi-model, rate limiting, quota system, webhooks
- Vue 3 SPA admin panel (src/) with Tailwind CSS
- Deployment: Docker multi-stage, docker-compose, nginx, systemd
- GORM/SQLite models: ApiKey, Model, UsageLog, Quota, Webhook
- REST API: /api/v1/admin/* (keys, models, chat, usage, health)
- Embedded frontend via go:embed (build output at web/dist/)

Removed legacy Python artifacts (app/, tests/, pyproject.toml, etc.)
2026-07-30 10:58:55 -04:00

54 lines
958 B
Docker

# Build stage
FROM node:20-alpine AS node-builder
WORKDIR /app
COPY web/frontend/package*.json ./
RUN npm ci
COPY web/frontend/ ./
RUN npm run build
# Go stage
FROM golang:1.23-alpine AS go-builder
RUN apk add --no-cache git ca-certificates
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Copy frontend build
COPY --from=node-builder /app/dist ./web/dist
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o llamalink ./cmd/llamalink
# Final stage
FROM alpine:3.19
RUN apk add --no-cache ca-certificates curl
WORKDIR /app
# Create non-root user
RUN addgroup -g 1000 llamalink && \
adduser -u 1000 -G llamalink -s /bin/sh -D llamalink
COPY --from=go-builder /app/llamalink .
COPY --from=go-builder /app/.env.example .env
# Create data directory
RUN mkdir -p /app/data && chown llamalink:llamalink /app/data
USER llamalink
EXPOSE 8000
ENV LLAMALINK_HOST=0.0.0.0
ENV LLAMALINK_PORT=8000
ENTRYPOINT ["./llamalink"]