HirCoir commited on
Commit
c118878
·
verified ·
1 Parent(s): d060f35

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -4
Dockerfile CHANGED
@@ -1,4 +1,10 @@
1
- FROM debian:11
 
 
 
 
 
 
2
 
3
  RUN apt-get update && apt-get install -y \
4
  python3 \
@@ -6,13 +12,12 @@ RUN apt-get update && apt-get install -y \
6
  python3-venv \
7
  git espeak-ng
8
 
9
- WORKDIR /root
10
  RUN git clone https://github.com/rhasspy/piper
11
  RUN pip install -q cython>=0.29.0 espeak-phonemizer>=1.1.0 librosa>=0.9.2 numpy>=1.19.0 pytorch-lightning~=1.7.0 torch~=1.11.0
12
  RUN pip install -q onnx onnxruntime
13
  RUN pip install -q torchtext==0.12.0
14
 
15
- WORKDIR /root/piper/src/python
16
  RUN bash build_monotonic_align.sh
17
  RUN pip install -q torchaudio==0.11.0 torchmetrics==0.11.4
18
  RUN pip install --upgrade gdown
@@ -23,7 +28,7 @@ RUN mkdir models
23
  RUN pip install flask flask-socketio flask-apscheduler huggingface_hub
24
 
25
  # Copy the application files
26
- WORKDIR /app
27
  COPY app.py .
28
  RUN mkdir templates
29
  COPY index.html ./templates/
 
1
+ FROM python:3.12
2
+
3
+ # Agrega un usuario no root
4
+ RUN useradd -m -u 1000 app
5
+
6
+ # Establece el directorio de trabajo dentro del contenedor
7
+ WORKDIR /home/app
8
 
9
  RUN apt-get update && apt-get install -y \
10
  python3 \
 
12
  python3-venv \
13
  git espeak-ng
14
 
 
15
  RUN git clone https://github.com/rhasspy/piper
16
  RUN pip install -q cython>=0.29.0 espeak-phonemizer>=1.1.0 librosa>=0.9.2 numpy>=1.19.0 pytorch-lightning~=1.7.0 torch~=1.11.0
17
  RUN pip install -q onnx onnxruntime
18
  RUN pip install -q torchtext==0.12.0
19
 
20
+ WORKDIR /home/app/piper/src/python
21
  RUN bash build_monotonic_align.sh
22
  RUN pip install -q torchaudio==0.11.0 torchmetrics==0.11.4
23
  RUN pip install --upgrade gdown
 
28
  RUN pip install flask flask-socketio flask-apscheduler huggingface_hub
29
 
30
  # Copy the application files
31
+ WORKDIR /home/app
32
  COPY app.py .
33
  RUN mkdir templates
34
  COPY index.html ./templates/