Spaces:
Paused
Paused
File size: 812 Bytes
0741fc9 33a497f 0741fc9 3cb4ef4 33a497f 3cb4ef4 0741fc9 33a497f 3cb4ef4 0741fc9 3cb4ef4 0741fc9 3cb4ef4 0741fc9 33a497f 0741fc9 3cb4ef4 33a497f 0741fc9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
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"]
|