Download Dockerfile from henztech/api: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/henztech/api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/henztech/api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/henztech/api/resolve/main/Dockerfile
1.18 kB
| # Use a lightweight Node.js image | |
| FROM node:18-bullseye | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies required for Playwright | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| wget \ | |
| curl \ | |
| unzip \ | |
| fonts-liberation \ | |
| libasound2 \ | |
| libatk-bridge2.0-0 \ | |
| libatk1.0-0 \ | |
| libcups2 \ | |
| libdbus-1-3 \ | |
| libgbm-dev \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| xdg-utils \ | |
| libu2f-udev \ | |
| libvulkan1 \ | |
| xvfb \ | |
| --no-install-recommends && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Clone the repository (Change the URL to your repo) | |
| RUN git clone https://github.com/EMMYHENZ-TECH/henz-api.git /app | |
| # Set correct permissions | |
| RUN chmod -R 777 /app | |
| # Install project dependencies | |
| WORKDIR /app | |
| RUN npm install | |
| # Set Playwright cache path | |
| ENV PLAYWRIGHT_BROWSERS_PATH=/home/node/.cache/ms-playwright | |
| # Install Playwright browsers (force full installation) | |
| RUN npx playwright install --with-deps chromium | |
| # Fix permissions for Playwright | |
| RUN chmod -R 777 /home/node/.cache/ms-playwright | |
| # Expose a port | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["node", "server.js"] |