Files
rag/Dockerfile

25 lines
437 B
Docker
Raw Permalink Normal View History

2026-06-10 16:36:46 +08:00
# 阶段1: 构建
FROM golang:alpine AS builder
2026-04-08 22:14:22 +08:00
2026-04-21 09:16:54 +08:00
RUN apk add --no-cache git ca-certificates tzdata
2026-06-10 16:36:46 +08:00
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2026-04-21 11:51:20 +08:00
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0
ENV GOTOOLCHAIN=auto
2026-04-21 09:16:54 +08:00
WORKDIR /build
COPY . .
2026-04-08 22:14:22 +08:00
2026-04-21 11:51:20 +08:00
RUN go mod download && go mod tidy
2026-04-08 22:14:22 +08:00
2026-04-21 11:51:20 +08:00
RUN go build -ldflags="-s -w" -o main ./main.go
2026-04-21 09:16:54 +08:00
2026-04-08 22:14:22 +08:00
2026-04-09 15:58:05 +08:00
EXPOSE 3006
2026-04-08 22:14:22 +08:00
2026-04-21 11:51:20 +08:00
CMD ["./main"]