Download Dockerfile from azils3/Tester: direct link, hf CLI and curl.
- Browser
- Download file 1.47 kB
-
https://huggingface.co/spaces/azils3/Tester/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/azils3/Tester/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/azils3/Tester/resolve/main/Dockerfile
1.47 kB
| # Builder stage | |
| FROM python:3.10.0 as builder | |
| # Create a non-root user | |
| RUN useradd -ms /bin/bash admin | |
| # Set the working directory | |
| WORKDIR /srv | |
| # Copy requirements file first to leverage caching | |
| COPY --chown=admin requirements.txt . | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| wget ffmpeg curl aria2 \ | |
| fonts-liberation \ | |
| libatk-bridge2.0-0 \ | |
| libatk1.0-0 \ | |
| libatspi2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libgbm1 \ | |
| libgtk-3-0 \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libu2f-udev \ | |
| libvulkan1 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| mesa-vulkan-drivers \ | |
| libxfixes3 \ | |
| libasound2 \ | |
| libxkbcommon0 \ | |
| libxrandr2 \ | |
| xdg-utils \ | |
| software-properties-common \ | |
| npm | |
| # Install latest npm and node | |
| RUN npm install npm@latest -g && \ | |
| npm install n -g && \ | |
| n latest | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Install unsilence | |
| RUN pipx ensurepath && \ | |
| pipx install unsilence | |
| # Copy the application code | |
| COPY --chown=admin . /srv | |
| # Command to run the application | |
| # CMD python -m uvicorn App.app:app --host 0.0.0.0 --port 7860 & python -m celery -A App.Worker.celery worker -c 5 --max-tasks-per-child=1 --without-heartbeat | |
| # Give read and write permissions to the admin user | |
| RUN chown -R admin:admin /srv | |
| RUN chmod 755 /srv | |
| USER admin | |
| CMD python -m uvicorn App.app:app --workers 1 --host 0.0.0.0 --port 7860 --log-level debug | |
| # Expose port | |
| EXPOSE 7860 |