docker fix
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
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 \
|
||||
ENV CGO_ENABLED=0 \
|
||||
GOOS=linux \
|
||||
GOARCH=amd64
|
||||
GOARCH=amd64 \
|
||||
GOPROXY=https://goproxy.cn|https://proxy.golang.google.cn|direct \
|
||||
GOSUMDB=sum.golang.google.cn
|
||||
|
||||
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
|
||||
go mod download -x
|
||||
|
||||
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
|
||||
go build -trimpath -ldflags="-s -w" -o /out/ai-chat-service ./chat-server
|
||||
|
||||
FROM alpine:3.18
|
||||
|
||||
@@ -31,4 +33,4 @@ 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"]
|
||||
CMD ["--config=config.yaml"]
|
||||
Reference in New Issue
Block a user