feat: update dockerfile

This commit is contained in:
2025-12-10 23:17:24 +08:00
parent 083142491f
commit 0bc77f61e2
18 changed files with 357 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
# Build stage
FROM registry.cn-beijing.aliyuncs.com/bitwsd/golang AS builder
FROM golang:1.20-alpine AS builder
WORKDIR /app
@@ -7,10 +8,10 @@ WORKDIR /app
COPY . .
# Build binary
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o main ./main.go
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o doc_ai ./main.go
# Runtime stage
FROM registry.cn-beijing.aliyuncs.com/bitwsd/alpine
FROM alpine:latest
# Set timezone
RUN apk add --no-cache tzdata && \
@@ -21,7 +22,7 @@ RUN apk add --no-cache tzdata && \
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/main .
COPY --from=builder /app/doc_ai .
# Copy config files
COPY config/config_*.yaml ./config/
@@ -34,7 +35,7 @@ RUN mkdir -p /data/formula && \
EXPOSE 8024
# Set entrypoint
ENTRYPOINT ["./main"]
ENTRYPOINT ["./doc_ai"]
# Default command (can be overridden)
CMD ["-env", "prod"]