Spaces:
Sleeping
Sleeping
| FROM python:3.10 | |
| # Set the working directory inside the container | |
| WORKDIR /ASF | |
| # Copy the requirements file and install dependencies | |
| COPY ./requirements.txt /asf-app/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /asf-app/requirements.txt | |
| # Create a user and switch to it | |
| RUN useradd user | |
| USER user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set the working directory for the app | |
| WORKDIR $HOME/app | |
| # Copy the application code into the container | |
| COPY --chown=user . $HOME/app | |
| # Ensure the templates folder is copied (make sure it exists in your local project structure) | |
| COPY ./templates /home/user/app/templates | |
| # Set the command to run the FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"] | |