File size: 585 Bytes
8e84046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Build stage
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY . .
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -o huggingface-cc

# Runtime stage
FROM alpine:3.22.0
RUN apk add --no-cache \
    git \
    bash \
    curl

RUN adduser -D -u 1000 user
USER user

# Install Hugging Face CLI and transformers
# RUN pip3 install --no-cache-dir --break-system-packages --user huggingface_hub transformers pytorch

# Copy binary from builder
COPY --chown=user:user --from=builder /app/huggingface-cc /usr/local/bin/

EXPOSE 8080
CMD ["huggingface-cc"]