Spaces:
Running
Running
File size: 742 Bytes
bc620e9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# 1. Use the specific Python version matching your local environment
FROM python:3.10.16-slim
# 2. Set the working directory inside the container
WORKDIR /code
# 3. Copy requirements first (for better caching)
COPY ./requirements.txt /code/requirements.txt
# 4. Install dependencies
# We use --no-cache-dir to keep the image small
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# 5. Copy the rest of your application code
COPY . /code
# 6. CRITICAL: Give write permissions to the backend folder
# This allows SQLite to create lock files and update the DB
RUN chmod -R 777 /code/backend
# 7. Start the app on port 7860 (Hugging Face default)
CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] |