Spaces:
Sleeping
Sleeping
Download Dockerfile from Chittrarasu/Population_api: direct link, hf CLI and curl.
- Browser
- Download file 896 Bytes
-
https://huggingface.co/spaces/Chittrarasu/Population_api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Chittrarasu/Population_api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Chittrarasu/Population_api/resolve/main/Dockerfile
896 Bytes
| # Use Python 3.11 as the base image | |
| FROM python:3.11 | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Copy all project files into the container | |
| COPY . /app | |
| # Install dependencies | |
| RUN pip install --upgrade pip | |
| RUN pip install -r requirement.txt | |
| # Expose the required port (Hugging Face Spaces uses 7860) | |
| EXPOSE 7860 | |
| # Ensure logs directory exists | |
| RUN mkdir -p /app/logs && chmod -R 777 /app/logs | |
| # Install tmux to run multiple processes | |
| RUN apt-get update && apt-get install -y tmux | |
| # Start FastAPI & Streamlit together using tmux | |
| # CMD ["sh", "-c", "tmux new-session -d -s fastapi 'uvicorn backend.main:app --host 0.0.0.0 --port 7860' && streamlit run Frontend/app.py --server.port 7860 --server.address 0.0.0.0"] | |
| CMD ["sh", "-c", "uvicorn backend.main:app --host 0.0.0.0 --port 8000 & sleep 5 && streamlit run Frontend/app.py --server.port 7860 --server.address 0.0.0.0"] | |