File size: 1,054 Bytes
6c0ac6b
 
dba8f72
 
 
 
 
 
 
6c0ac6b
40b10b7
692d290
6c0ac6b
9d69895
 
 
692d290
40b10b7
6c0ac6b
dba8f72
 
190f6f0
9d69895
 
 
190f6f0
 
dba8f72
 
 
9d69895
683e9cd
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
29
30
31
32
33
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"]