opencode-cursor-agent/Dockerfile

25 lines
776 B
Docker
Raw Normal View History

2026-04-01 04:32:17 +00:00
# ── Stage 1: 編譯 ─────────────────────────────────────────────
FROM golang:1.24-alpine AS builder
WORKDIR /build
COPY go.mod go.sum ./
# 臨時降版 go directive 以符合 1.24 編譯器,不修改原始 go.mod
RUN go mod edit -go=1.24 && go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o cursor-api-proxy .
# ── Stage 2: 執行環境 ──────────────────────────────────────────
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /build/cursor-api-proxy .
EXPOSE 8766
ENTRYPOINT ["./cursor-api-proxy"]