| |
| FROM golang:1.24-alpine AS builder |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apk add --no-cache git ca-certificates |
|
|
| |
| COPY go.mod go.sum ./ |
|
|
| |
| RUN go mod download |
|
|
| |
| COPY . . |
|
|
| |
| RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o cursor2api-go . |
|
|
| |
| FROM alpine:latest |
|
|
| |
| RUN apk --no-cache add ca-certificates nodejs npm |
|
|
| |
| RUN adduser -D -g '' appuser |
|
|
| WORKDIR /root/ |
|
|
| |
| COPY --from=builder /app/cursor2api-go . |
|
|
| |
| COPY --from=builder /app/static ./static |
| COPY --from=builder /app/jscode ./jscode |
|
|
| |
| RUN chown -R appuser:appuser /root/ |
|
|
| |
| USER appuser |
|
|
| |
| EXPOSE 8002 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ |
| CMD node -e "require('http').get('http://localhost:8002/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))" || exit 1 |
|
|
| |
| CMD ["./cursor2api-go"] |