Spaces:
Sleeping
Sleeping
Download Dockerfile from Rsnarsna/phi4-docker-space: direct link, hf CLI and curl.
- Browser
- Download file 767 Bytes
-
https://huggingface.co/spaces/Rsnarsna/phi4-docker-space/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Rsnarsna/phi4-docker-space/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Rsnarsna/phi4-docker-space/resolve/main/Dockerfile
767 Bytes
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set the working directory in the container | |
| WORKDIR /code | |
| # Copy the requirements file into the container | |
| COPY requirements.txt /code/requirements.txt | |
| # Install dependencies | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Add a user with a home directory | |
| RUN useradd -m -u 1000 user | |
| # Switch to the new user | |
| USER user | |
| # Define environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set the working directory to the user's home directory | |
| WORKDIR $HOME/app | |
| # Copy the rest of the application code and change ownership | |
| COPY --chown=user . $HOME/app | |
| # Run the application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |