Spaces:
Running
Running
FROM python:3.10 | |
# Set working directory | |
WORKDIR /code | |
# Set environment variables to prevent permission issues | |
ENV HF_HOME=/code/.cache | |
ENV PYTHONUSERBASE=/code/.local | |
ENV PATH="/code/.local/bin:$PATH" | |
ENV PIP_NO_CACHE_DIR=1 | |
# Copy and install dependencies | |
COPY requirements.txt /code/requirements.txt | |
RUN pip install --no-cache-dir --upgrade --user -r /code/requirements.txt | |
# Ensure necessary directories exist with proper permissions | |
RUN mkdir -p /code/uploads /code/images /code/.cache /code/.local && chmod -R 777 /code/uploads /code/images /code/.cache /code/.local | |
# Copy application files | |
COPY . . | |
COPY en.txt /code/en.txt | |
# Install SpaCy model explicitly | |
RUN python -m spacy download en_core_web_sm --user | |
# Run the application | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |