This commit is contained in:
1iaan
2026-04-10 12:00:03 +08:00
parent 94bdba930e
commit 5ce2a5f1a3
150 changed files with 215 additions and 20694 deletions

View File

@@ -1,11 +1,34 @@
FROM golang:1.25 AS builder
ENV GOPROXY=https://proxy.golang.com.cn,https://goproxy.cn,direct \
GOSUMDB=sum.golang.google.cn \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64
WORKDIR /src/ai-chat-service
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -o /out/ai-chat-service ./chat-server
FROM alpine:3.18
ADD ./grpc_health_probe-linux-amd64 /usr/bin/grpc_health_probe
RUN chmod +x /usr/bin/grpc_health_probe
LABEL maintainer="nick"
WORKDIR /app/
COPY ./ai-chat-service-bin ./ai-chat-service
COPY --from=builder /out/ai-chat-service ./ai-chat-service
COPY ./docker.config.yaml /app/config.yaml
# 指定入口程序
ENTRYPOINT ["./ai-chat-service"]
# 指定容器的启动命令或者入口程序的参数
CMD ["--config=config.yaml"]