Download Dockerfile from rr1/mncp: direct link, hf CLI and curl.
- Browser
- Download file 681 Bytes
-
https://huggingface.co/spaces/rr1/mncp/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/rr1/mncp/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/rr1/mncp/resolve/main/Dockerfile
681 Bytes
| # 使用适合Go应用的基础镜像 | |
| FROM golang:alpine AS builder | |
| ARG TARGETOS | |
| ARG TARGETARCH | |
| RUN apk update && apk add --no-cache upx make git && rm -rf /var/cache/apk/* | |
| RUN git clone https://github.com/ycvk/monica-proxy.git /app | |
| # 设置工作目录 | |
| WORKDIR /app | |
| RUN sed -i 's/\/v1\/chat\/completions/\/hf\/v1\/chat\/completions/g' internal/apiserver/router.go | |
| RUN sed -i 's/\/v1\/models/\/hf\/v1\/models/g' internal/apiserver/router.go | |
| # 下载依赖 | |
| RUN go mod tidy | |
| # 构建应用程序 | |
| RUN make build-${TARGETOS}-${TARGETARCH} | |
| FROM scratch AS final | |
| WORKDIR /data | |
| COPY --from=builder /app/build/monica /data/monica | |
| # 开放端口 | |
| EXPOSE 8080 | |
| # 运行 | |
| CMD ["./monica"] |