Spaces:
Runtime error
Runtime error
Download Dockerfile from KN123/nl2sql-api: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/KN123/nl2sql-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/KN123/nl2sql-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/KN123/nl2sql-api/resolve/main/Dockerfile
702 Bytes
| FROM python:3.9 | |
| # Set working directory | |
| WORKDIR /code | |
| # Copy requirements file and install dependencies | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Create a non-root user | |
| RUN useradd user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Switch to the non-root user | |
| USER user | |
| # Set working directory for the application | |
| WORKDIR $HOME/app | |
| # Copy application code into the container | |
| COPY --chown=user . $HOME/app | |
| # Expose port | |
| EXPOSE 7860 | |
| # Command to run the FastAPI application using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |