Spaces:
Build error
Build error
| # Use the official Python 3.10 image as the base | |
| FROM python:3.10 | |
| # Install necessary packages and clean up APT cache | |
| RUN apt-get update && \ | |
| apt-get install -y apt-utils fakeroot && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Create a user for the application | |
| RUN useradd -m -u 1000 user | |
| # Set the user for subsequent commands | |
| USER user | |
| # Set the working directory | |
| WORKDIR /home/user/app | |
| # Copy the requirements.txt file into the container | |
| COPY requirements.txt . | |
| # Upgrade pip to the latest version | |
| RUN pip install --upgrade pip | |
| # Install the required Python packages | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of your application code into the container | |
| COPY . . | |
| # Specify the command to run your application (modify as needed) | |
| # CMD ["python", "your_script.py"] | |