Download Dockerfile from wusamalo/test: direct link, hf CLI and curl.
- Browser
- Download file 448 Bytes
-
https://huggingface.co/spaces/wusamalo/test/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/wusamalo/test/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/wusamalo/test/resolve/main/Dockerfile
448 Bytes
| FROM node:18-slim | |
| # 1. 切换到镜像自带的 node 用户(其 UID 就是 1000) | |
| USER node | |
| # 2. 设置环境变量和工作目录 | |
| ENV HOME=/home/node | |
| WORKDIR $HOME/app | |
| # 3. 复制文件并确保权限属于 node 用户 | |
| # 使用 --chown=node:node 是关键,防止权限报错 | |
| COPY --chown=node:node package*.json ./ | |
| RUN npm install | |
| COPY --chown=node:node . . | |
| # 4. 暴露 Hugging Face 指定的端口 | |
| EXPOSE 7860 | |
| CMD ["node", "index.js"] | |