Spaces:
Sleeping
Sleeping
Download Dockerfile from duqing2026/react-native-app: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/spaces/duqing2026/react-native-app/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/duqing2026/react-native-app/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/duqing2026/react-native-app/resolve/main/Dockerfile
524 Bytes
| # 使用 Node.js LTS 版本作为基础镜像 | |
| FROM node:20-slim | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 安装必要的构建工具和 serve | |
| RUN npm install -g serve | |
| # 复制 package.json 和 package-lock.json | |
| COPY package*.json ./ | |
| # 安装项目依赖 | |
| RUN npm install | |
| # 复制项目源代码 | |
| COPY . . | |
| # 构建 Web 版本 | |
| RUN npx expo export --platform web | |
| # 暴露端口 (Hugging Face Spaces 默认使用 7860) | |
| EXPOSE 7860 | |
| # 运行服务,将静态资源映射到 7860 端口 | |
| CMD ["serve", "-s", "dist", "-l", "7860"] | |