Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +51 -0
Dockerfile
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.10.12-slim
|
3 |
+
|
4 |
+
# Install required packages for building eSpeak and general utilities
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
build-essential \
|
7 |
+
autoconf \
|
8 |
+
automake \
|
9 |
+
libtool \
|
10 |
+
pkg-config \
|
11 |
+
git \
|
12 |
+
cmake
|
13 |
+
|
14 |
+
RUN git clone -b dev-ca https://github.com/projecte-aina/espeak-ng
|
15 |
+
|
16 |
+
RUN pip install --upgrade pip && \
|
17 |
+
cd espeak-ng && \
|
18 |
+
./autogen.sh && \
|
19 |
+
./configure --prefix=/usr && \
|
20 |
+
make && \
|
21 |
+
make install
|
22 |
+
|
23 |
+
RUN mkdir -p cache && chmod 777 cache
|
24 |
+
|
25 |
+
RUN useradd -m -u 1000 user
|
26 |
+
|
27 |
+
USER user
|
28 |
+
|
29 |
+
ENV HOME=/home/user \
|
30 |
+
PATH=/home/user/.local/bin:$PATH
|
31 |
+
|
32 |
+
# Set the working directory to the user's home directory
|
33 |
+
WORKDIR $HOME/app
|
34 |
+
|
35 |
+
COPY --chown=user requirements.txt .
|
36 |
+
|
37 |
+
# Install Python packages
|
38 |
+
RUN pip install -r requirements.txt
|
39 |
+
|
40 |
+
RUN pip install mecab-python3 unidic-lite
|
41 |
+
|
42 |
+
RUN pip install python-dotenv
|
43 |
+
|
44 |
+
COPY --chown=user . .
|
45 |
+
|
46 |
+
ENV NUMBA_CACHE_DIR=/home/user/cache
|
47 |
+
ENV MPLCONFIGDIR=/home/user/cache
|
48 |
+
|
49 |
+
EXPOSE 7860
|
50 |
+
|
51 |
+
CMD ["python3", "-u", "app.py"]
|