Download Dockerfile from zxwreader/onetime: direct link, hf CLI and curl.
- Browser
- Download file 898 Bytes
-
https://huggingface.co/spaces/zxwreader/onetime/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/zxwreader/onetime/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/zxwreader/onetime/resolve/main/Dockerfile
898 Bytes
| FROM node:22 AS builder | |
| WORKDIR /app | |
| # 安装 pnpm | |
| RUN npm install -g pnpm | |
| # 获取项目代码 | |
| RUN git clone https://github.com/corentinth/enclosed.git ./ | |
| # 安装项目依赖 | |
| RUN pnpm install --frozen-lockfile --ignore-scripts | |
| # 构建项目 | |
| RUN pnpm --filter @enclosed/crypto run build && \ | |
| pnpm --filter @enclosed/lib run build && \ | |
| pnpm --filter @enclosed/app-client run build && \ | |
| pnpm --filter @enclosed/app-server run build:node | |
| FROM node:22-slim | |
| WORKDIR /app | |
| COPY --from=builder /app/packages/app-client/dist ./public | |
| COPY --from=builder /app/packages/app-server/dist-node/index.cjs ./index.cjs | |
| RUN mkdir -p /persistent/.data && \ | |
| rm -rf /app/.data && \ | |
| ln -s /persistent/.data /app/.data | |
| RUN chmod -R 777 /persistent/.data | |
| # 设置环境变量 | |
| ENV NODE_ENV=production | |
| ENV PORT=7860 | |
| # 暴露端口 | |
| EXPOSE 7860 | |
| # 启动应用程序 | |
| CMD ["node", "index.cjs"] |