# PUBLIC DOMAIN - NO LICENSE, NO WARRANTY
# Copyright 2025 TimeHexOn & foxhop & russell@unturf
# https://www.permacomputer.com

# Pin to specific Go version (checked 2025-10-13: golang:1.23-alpine is latest stable)
FROM golang:1.23-alpine AS builder

# Install ca-certificates for HTTPS requests
RUN apk --no-cache add ca-certificates

WORKDIR /app

# Copy module files and source
COPY go.mod .
COPY uncloseai.go .

# Build the application
RUN go build -o uncloseai uncloseai.go

# Use minimal alpine image for runtime
FROM alpine:latest

# Install ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates

WORKDIR /app

COPY --from=builder /app/uncloseai .

CMD ["./uncloseai"]
