16 lines
396 B
Docker
16 lines
396 B
Docker
# 神识(Go 模型网关)构建与运行
|
|
FROM golang:1.25-alpine AS builder
|
|
WORKDIR /src
|
|
COPY go.mod ./
|
|
RUN go mod download || true
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/shenshi .
|
|
|
|
FROM alpine:3.20
|
|
RUN adduser -D -H -u 10001 shenshi
|
|
USER shenshi
|
|
COPY --from=builder /out/shenshi /usr/local/bin/shenshi
|
|
ENV SHENSHI_PORT=8080
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["shenshi"]
|