-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 1.24 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (32 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# syntax=docker/dockerfile:1
# -----------------------------------------------------------------------------
# Build stage
# -----------------------------------------------------------------------------
FROM golang:1.22-alpine AS builder
WORKDIR /src
RUN apk add --no-cache ca-certificates git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG TARGETOS=linux
ARG TARGETARCH=amd64
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w" \
-o /out/LLMProxyAS \
./cmd/server
# -----------------------------------------------------------------------------
# Runtime stage (minimal, non-root)
# -----------------------------------------------------------------------------
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata \
&& adduser -D -H -u 10001 appuser
WORKDIR /app
COPY --from=builder /out/LLMProxyAS /app/LLMProxyAS
# Default configs; override at runtime with a volume mount (see compose).
COPY configs/ /app/configs/
USER appuser
EXPOSE 20182
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -qO- http://127.0.0.1:20182/health || exit 1
ENTRYPOINT ["/app/LLMProxyAS"]
CMD ["-config", "configs/config.json", "-models", "configs/allowed_models.json"]