Spaces:
Sleeping
Sleeping
Download Dockerfile from Shivam4096/Financial2API: direct link, hf CLI and curl.
- Browser
- Download file 2.75 kB
-
https://huggingface.co/spaces/Shivam4096/Financial2API/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Shivam4096/Financial2API/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Shivam4096/Financial2API/resolve/main/Dockerfile
2.75 kB
| # ββ Base βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| # ββ System dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| gcc \ | |
| libxml2-dev \ | |
| libxslt-dev \ | |
| zlib1g-dev \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ββ Create a non-root user (Required for Hugging Face Spaces) ββββββββββββββββββ | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # ββ Setup environment ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set the working directory to the user's home directory | |
| WORKDIR $HOME/app | |
| # ββ Install Python dependencies ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Copy requirements first to leverage Docker cache | |
| COPY --chown=user web_app/requirements.txt ./requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ββ Copy full application source βββββββββββββββββββββββββββββββββββββββββββββββ | |
| COPY --chown=user . $HOME/app | |
| # ββ Create writable directories ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN mkdir -p outputs storage web_app/__pycache__ | |
| # ββ Streamlit config β disable telemetry, set port ββββββββββββββββββββββββββββ | |
| RUN mkdir -p $HOME/.streamlit \ | |
| && cp web_app/streamlit_config.toml $HOME/.streamlit/config.toml | |
| # ββ HF Spaces: port 7860 ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| EXPOSE 7860 | |
| # ββ Launch Streamlit βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| CMD ["streamlit", "run", "web_app/app.py", \ | |
| "--server.port=7860", \ | |
| "--server.address=0.0.0.0", \ | |
| "--server.headless=true", \ | |
| "--browser.gatherUsageStats=false"] | |