File size: 532 Bytes
79d8a2e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Hugging Face Docker Space image for the Go OpenAI-compatible proxy.
FROM golang:alpine AS builder

WORKDIR /src
COPY go.mod ./
COPY main.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/scnet-proxy ./main.go

FROM alpine:latest

RUN apk --no-cache add ca-certificates tzdata \
    && adduser -D -u 1000 user

WORKDIR /app
COPY --from=builder /out/scnet-proxy /app/scnet-proxy

ENV HOST=0.0.0.0 \
    PORT=7860 \
    CACHE_FILE=/tmp/conversations.json

EXPOSE 7860
USER user

CMD ["/app/scnet-proxy"]