Download Dockerfile from alaskavix/README: direct link, hf CLI and curl.
- Browser
- Download file 893 Bytes
-
https://huggingface.co/spaces/alaskavix/README/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/alaskavix/README/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/alaskavix/README/resolve/main/Dockerfile
893 Bytes
| FROM python:3.9 | |
| # Install aria2 | |
| RUN apt-get update && apt-get install -y aria2 | |
| # Create aria2 configuration file | |
| RUN echo "enable-rpc=true" > /etc/aria2.conf && \ | |
| echo "rpc-listen-all=true" >> /etc/aria2.conf && \ | |
| echo "rpc-allow-origin-all=true" >> /etc/aria2.conf && \ | |
| echo "rpc-listen-port=6800" >> /etc/aria2.conf | |
| # Create a user and set up the environment | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the application code | |
| COPY --chown=user . /app | |
| # Start aria2 in the background and the application in the foreground | |
| CMD ["sh", "-c", "aria2c --conf-path=/etc/aria2.conf -D && gunicorn -k uvicorn.workers.UvicornWorker app:app --bind 0.0.0.0:7860", "python", "alive.py"] | |