Spaces:
Runtime error
Runtime error
Download Dockerfile from Noel-Teens/Add-Sub: direct link, hf CLI and curl.
- Browser
- Download file 1.53 kB
-
https://huggingface.co/spaces/Noel-Teens/Add-Sub/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Noel-Teens/Add-Sub/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Noel-Teens/Add-Sub/resolve/main/Dockerfile
1.53 kB
| # FROM python:3.10-slim | |
| # # Install system dependencies (SQLite tools & optional debugging) | |
| # RUN apt-get update && apt-get install -y \ | |
| # libsqlite3-dev \ | |
| # && rm -rf /var/lib/apt/lists/* | |
| # # Create non-root user | |
| # RUN useradd -ms /bin/bash user | |
| # # Set workdir | |
| # WORKDIR /app | |
| # # Copy requirements & install as root | |
| # COPY requirements.txt . | |
| # RUN pip install --no-cache-dir -r requirements.txt | |
| # # Copy project files | |
| # COPY . . | |
| # RUN python manage.py makemigrations | |
| # RUN python manage.py migrate | |
| # # Fix permissions: allow user to write to /app and any subdirs | |
| # RUN mkdir -p /app \ | |
| # && chown -R user:user /app | |
| # # Switch to non-root user | |
| # USER user | |
| # # Expose Django port | |
| # EXPOSE 7860 | |
| # # Run server | |
| # CMD ["python", "manage.py", "runserver", "0.0.0.0:7860"] | |
| FROM python:3.10-slim | |
| # Install dependencies | |
| RUN apt-get update && apt-get install -y libsqlite3-dev && rm -rf /var/lib/apt/lists/* | |
| # Create a non-root user for better security | |
| RUN useradd -ms /bin/bash user | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy requirements.txt and install dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the entire application code | |
| COPY . . | |
| # Change ownership to the non-root user for security | |
| RUN chown -R user:user /app | |
| # Switch to the non-root user | |
| USER user | |
| # Expose port 7860 for Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Run Django server on port 7860, binding to 0.0.0.0 | |
| CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:7860"] |