Download Dockerfile from bg5/zai2api3: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/bg5/zai2api3/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/bg5/zai2api3/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/bg5/zai2api3/resolve/main/Dockerfile
1.1 kB
| FROM golang:1.25 AS builder | |
| ENV GOPROXY=https://goproxy.cn,direct | |
| WORKDIR /src | |
| COPY go.mod go.sum ./ | |
| RUN go mod download | |
| COPY . . | |
| RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /zai2api ./cmd/main.go | |
| FROM node:20-bookworm-slim | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| BROWSER_BACKEND=cloak \ | |
| POOL_SIZE=0 \ | |
| CHROMIUM_PATH=/usr/bin/chromium \ | |
| CAPTCHA_PROVIDER_URL=http://127.0.0.1:9876 \ | |
| LOG_LEVEL=info \ | |
| PORT=7860 \ | |
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 | |
| RUN apt-get update \ | |
| && apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| chromium \ | |
| fonts-liberation \ | |
| libnss3 \ | |
| libxss1 \ | |
| tini \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY --from=builder /zai2api /app/zai2api | |
| COPY captcha-provider/package*.json /app/captcha-provider/ | |
| RUN cd /app/captcha-provider \ | |
| && npm ci --omit=dev \ | |
| && npm cache clean --force | |
| COPY captcha-provider /app/captcha-provider | |
| COPY init.sh /app/init.sh | |
| RUN mkdir -p /app/data \ | |
| && chmod +x /app/init.sh | |
| EXPOSE 7860 | |
| ENTRYPOINT ["tini", "--"] | |
| CMD ["/app/init.sh"] | |