Download Dockerfile from coo7/monixxca: direct link, hf CLI and curl.
- Browser
- Download file 605 Bytes
-
https://huggingface.co/spaces/coo7/monixxca/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/coo7/monixxca/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/coo7/monixxca/resolve/main/Dockerfile
605 Bytes
| # 使用适合Go应用的基础镜像 | |
| FROM golang:alpine AS builder | |
| ARG TARGETOS | |
| ARG TARGETARCH | |
| RUN apk update && apk add --no-cache upx make && rm -rf /var/cache/apk/* | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 复制所有文件到容器中 | |
| COPY . . | |
| # 下载依赖 | |
| RUN go mod tidy | |
| # 构建应用程序 | |
| RUN make build-${TARGETOS}-${TARGETARCH} | |
| FROM alpine:latest AS final | |
| RUN apk --no-cache add ca-certificates && \ | |
| mkdir -p /data && \ | |
| chmod 777 /data | |
| WORKDIR /data | |
| COPY --from=builder /app/build/monica /data/monica | |
| RUN chmod +x /data/monica | |
| # 开放端口 | |
| EXPOSE 7860 | |
| # 运行 | |
| CMD ["./monica"] |