Spaces:
Sleeping
Sleeping
Download Dockerfile from afnhf/dynamo-backend: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/spaces/afnhf/dynamo-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/afnhf/dynamo-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/afnhf/dynamo-backend/resolve/main/Dockerfile
769 Bytes
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Prevent Python from writing pyc files to disc and buffering stdout/stderr | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy project files | |
| COPY . . | |
| # Create required runtime directories | |
| RUN mkdir -p bin/model bin/data | |
| # Hugging Face Spaces exposes port 7860 by default | |
| EXPOSE 7860 | |
| # Run database migrations and start Django server on port 7860 | |
| CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:7860"] | |