Spaces:
Sleeping
Sleeping
Download Dockerfile from Chittrarasu/Population_FastAPI: direct link, hf CLI and curl.
- Browser
- Download file 697 Bytes
-
https://huggingface.co/spaces/Chittrarasu/Population_FastAPI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Chittrarasu/Population_FastAPI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Chittrarasu/Population_FastAPI/resolve/main/Dockerfile
697 Bytes
| # Use Python 3.11 as the base image | |
| # FROM python:3.11 | |
| FROM python:3.11-slim | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Copy all project files into the container | |
| COPY . /app | |
| RUN mkdir -p /app/logs && chmod -R 777 /app/logs | |
| # Install dependencies | |
| RUN pip install --upgrade pip | |
| # Disable cache for pip installs | |
| RUN pip install --no-cache-dir -r requirement.txt | |
| # Set PYTHONPATH so FastAPI can find the 'backend' module | |
| ENV PYTHONPATH=/app | |
| # Expose the required port | |
| EXPOSE 7860 | |
| # Start FastAPI with the correct module path | |
| # CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"] | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |