Spaces:
Runtime error
Runtime error
FROM python:3.10.9 | |
# Install ffmpeg, mecab, and other required packages | |
RUN apt-get update && \ | |
apt-get install -y ffmpeg mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file sudo && \ | |
apt-get clean | |
# Install mecab-python3 and unidic-lite for Japanese text processing | |
RUN pip install --no-cache-dir mecab-python3 unidic-lite | |
# Set the working directory | |
WORKDIR /app | |
# Copy all files into the container | |
COPY . . | |
# Install Python dependencies | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Set environment variable for the model download path | |
ENV XDG_CACHE_HOME=/app/.local | |
RUN mkdir -p /app/.local && chmod -R 777 /app/.local | |
# Resolve numba caching issue by setting the NUMBA_CACHE_DIR environment variable | |
ENV NUMBA_CACHE_DIR=/tmp/numba_cache | |
RUN mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache | |
# Set environment variable for matplotlib | |
ENV MPLCONFIGDIR=/tmp/matplotlib | |
RUN mkdir -p /tmp/matplotlib && chmod -R 777 /tmp/matplotlib | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |