Spaces:
Paused
Paused
Download Dockerfile from privateone/ONesAPI: direct link, hf CLI and curl.
- Browser
- Download file 923 Bytes
-
https://huggingface.co/spaces/privateone/ONesAPI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/privateone/ONesAPI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/privateone/ONesAPI/resolve/main/Dockerfile
923 Bytes
| FROM python:3.11 | |
| # Create and use a non-root user | |
| RUN useradd -ms /bin/bash admin | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy only the necessary files first for better cache utilization | |
| COPY requirements.txt /app/requirements.txt | |
| # Install system dependencies and clean up in a single RUN step to reduce layers | |
| RUN apt-get update -y && apt-get upgrade -y \ | |
| && apt-get install -y \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| RUN pip3 install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the rest of the application code after installing dependencies for better cache | |
| COPY . /app | |
| # Set ownership and permissions for the app directory | |
| RUN chown -R admin:admin /app && chmod -R 777 /app | |
| # Switch to the non-root user for better security | |
| USER admin | |
| # Expose the port the application will run on | |
| EXPOSE 7860 | |
| # Command to run the application | |
| CMD ["python", "-u", "main.py"] |