Spaces:
Sleeping
Sleeping
Download Dockerfile from LalitChaudhari3/PlainSQL-Agent: direct link, hf CLI and curl.
- Browser
- Download file 822 Bytes
-
https://huggingface.co/spaces/LalitChaudhari3/PlainSQL-Agent/resolve/00a888ebf891bf46170f7dd295ce7c7a7bfd39f1/Dockerfile
- Command line
-
hf download hf://spaces/LalitChaudhari3/PlainSQL-Agent@00a888ebf891bf46170f7dd295ce7c7a7bfd39f1/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/LalitChaudhari3/PlainSQL-Agent/resolve/00a888ebf891bf46170f7dd295ce7c7a7bfd39f1/Dockerfile
822 Bytes
| # 1. Use Python 3.9 | |
| FROM python:3.9 | |
| # 2. Set up the user FIRST (Security requirement) | |
| RUN useradd -m -u 1000 user | |
| # 3. Set Working Directory | |
| WORKDIR /code | |
| # 4. Copy Requirements & Install | |
| COPY --chown=user ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # 5. COPY EVERYTHING with Ownership Fix | |
| # This tells Docker: "Make 'user' the owner of all these files, not Root" | |
| COPY --chown=user . /code | |
| # 6. FORCE PERMISSIONS (The Fix for Error 13) | |
| # This grants Read/Write access to the folder so SQLite can create lock files | |
| RUN chmod -R 777 /code | |
| # 7. Switch to the non-root user | |
| USER user | |
| # 8. Set Environment Variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # 9. Run the App | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |