Files
hr_data_analyzer/Dockerfile
2025-03-21 09:17:02 +08:00

17 lines
327 B
Docker

# 构建阶段
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
ENV GOPROXY=https://goproxy.cn,direct
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o main .
# 运行阶段
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/main .
COPY config.yaml ./
EXPOSE 8080
CMD ["./main"]