# Build stage FROM registry.cn-beijing.aliyuncs.com/bitwsd/golang AS builder WORKDIR /app # Copy source code COPY . . # Build binary RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o main ./main.go # Runtime stage FROM registry.cn-beijing.aliyuncs.com/bitwsd/alpine # Set timezone RUN apk add --no-cache tzdata && \ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ echo "Asia/Shanghai" > /etc/timezone WORKDIR /app # Copy binary from builder COPY --from=builder /app/main . # Copy config files COPY config/config_*.yaml ./config/ # Create data directory RUN mkdir -p /data/formula && \ chmod -R 755 /data # Expose port (update based on your config) EXPOSE 8024 # Set entrypoint ENTRYPOINT ["./main"] # Default command (can be overridden) CMD ["-env", "prod"]