Spaces:
Sleeping
Sleeping
Download Dockerfile from Swapnil-101/course_recommend: direct link, hf CLI and curl.
- Browser
- Download file 903 Bytes
-
https://huggingface.co/spaces/Swapnil-101/course_recommend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Swapnil-101/course_recommend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Swapnil-101/course_recommend/resolve/main/Dockerfile
903 Bytes
| FROM python:3.9 | |
| RUN pwd && ls -l | |
| # Create a user with UID 1000 | |
| RUN useradd -m -u 1000 user | |
| # Set the working directory and user environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Switch to the user's home directory | |
| WORKDIR $HOME | |
| # Copy the application files into the user's home directory | |
| COPY --chown=user:user . $HOME | |
| # Copy the requirements file to the /code directory | |
| COPY ./requirements.txt /code/requirements.txt | |
| # Install the Python dependencies | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Create a directory for cache and set permissions | |
| RUN mkdir -p $HOME/.cache && chmod 777 $HOME/.cache | |
| # Switch back to the user | |
| USER user | |
| # Set the working directory for the application | |
| WORKDIR $HOME | |
| RUN pwd && ls -l | |
| # Start the application using gunicorn | |
| CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "--timeout", "300", "main:app"] | |