File size: 539 Bytes
65d037a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8c1976c
65d037a
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM golang:1.24.2-alpine AS builder

WORKDIR /app

ENV GO111MODULE=on \
    CGO_ENABLED=0

COPY go.mod go.sum ./

RUN go mod download

COPY . .

# -ldflags "-s -w": Strips debug symbols and DWARF tables, significantly reducing binary size.
RUN go build -o /app/niyam -ldflags "-s -w" ./main.go

FROM scratch

WORKDIR /app

# Copy only the compiled binary from the 'builder' stage
COPY --from=builder /app/niyam .

# Hugging Face Spaces often expose port 7860 by default for Gradio/Streamlit, still exposing...
EXPOSE 7860

CMD ["./niyam"]