Download Dockerfile from DitzDevs/ytdl-api: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/DitzDevs/ytdl-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/DitzDevs/ytdl-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/DitzDevs/ytdl-api/resolve/main/Dockerfile
1.29 kB
| # Use Latest Node.js LTS base image with Debian | |
| FROM node:21-bullseye | |
| # Environment variables | |
| ENV TZ=Asia/Jakarta \ | |
| DEBIAN_FRONTEND=noninteractive \ | |
| PORT=7860 \ | |
| MADE=DITZDEV | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| imagemagick \ | |
| webp \ | |
| python3 \ | |
| python3-pip \ | |
| git \ | |
| ca-certificates \ | |
| fonts-liberation \ | |
| fonts-dejavu \ | |
| fonts-noto-color-emoji \ | |
| # Clean up | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && apt-get clean | |
| # Set timezone | |
| RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
| # Create app directory | |
| WORKDIR /app | |
| # Clone private repo using a secret | |
| RUN --mount=type=secret,id=GITHUB_REPO,required=true \ | |
| git clone $(cat /run/secrets/GITHUB_REPO) DITZDEV-SERVER | |
| # Set working directory to cloned repo | |
| WORKDIR /app/DITZDEV-SERVER | |
| # Install Node.js dependencies | |
| COPY package*.json ./ | |
| RUN npm ci --only=production \ | |
| && npm cache clean --force | |
| # Install Python dependencies (if needed) | |
| # COPY requirements.txt ./ | |
| # RUN python3 -m pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Set permissions | |
| RUN chmod -R 777 /app | |
| # Expose port | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["node", "index.js"] |