Update Dockerfile
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
@@ -1,7 +1,12 @@
|
|
1 |
FROM python:3.10.9
|
2 |
|
3 |
-
# Install ffmpeg and
|
4 |
-
RUN apt-get update &&
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# Set the working directory
|
7 |
WORKDIR /app
|
@@ -12,14 +17,16 @@ COPY . .
|
|
12 |
# Install Python dependencies
|
13 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
14 |
|
15 |
-
# Set
|
|
|
16 |
RUN mkdir -p /app/.local && chmod -R 777 /app/.local
|
17 |
|
18 |
# Resolve numba caching issue by setting the NUMBA_CACHE_DIR environment variable
|
19 |
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
20 |
RUN mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache
|
21 |
|
22 |
-
# Set environment variable for
|
23 |
-
ENV
|
|
|
24 |
|
25 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
FROM python:3.10.9
|
2 |
|
3 |
+
# Install ffmpeg, mecab, and other required packages
|
4 |
+
RUN apt-get update && \
|
5 |
+
apt-get install -y ffmpeg mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file sudo && \
|
6 |
+
apt-get clean
|
7 |
+
|
8 |
+
# Install mecab-python3 and unidic-lite for Japanese text processing
|
9 |
+
RUN pip install --no-cache-dir mecab-python3 unidic-lite
|
10 |
|
11 |
# Set the working directory
|
12 |
WORKDIR /app
|
|
|
17 |
# Install Python dependencies
|
18 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
19 |
|
20 |
+
# Set environment variable for the model download path
|
21 |
+
ENV XDG_CACHE_HOME=/app/.local
|
22 |
RUN mkdir -p /app/.local && chmod -R 777 /app/.local
|
23 |
|
24 |
# Resolve numba caching issue by setting the NUMBA_CACHE_DIR environment variable
|
25 |
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
26 |
RUN mkdir -p /tmp/numba_cache && chmod -R 777 /tmp/numba_cache
|
27 |
|
28 |
+
# Set environment variable for matplotlib
|
29 |
+
ENV MPLCONFIGDIR=/tmp/matplotlib
|
30 |
+
RUN mkdir -p /tmp/matplotlib && chmod -R 777 /tmp/matplotlib
|
31 |
|
32 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|