Spaces:
Sleeping
Sleeping
| # ===== BUILD STAGE ===== | |
| FROM golang:1.22-alpine AS builder | |
| WORKDIR /app | |
| # Buat go.mod & go.sum otomatis dengan nama module gemini_textai | |
| RUN go mod init gemini_textai | |
| COPY main.go ./ | |
| RUN go mod tidy | |
| # Build binary | |
| RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app | |
| # ===== RUNTIME STAGE ===== | |
| FROM alpine:latest | |
| WORKDIR /app | |
| COPY --from=builder /app/app . | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| CMD ["./app"] |