Skip to content

Commit dc00fad

Browse files
committed
减小镜像
1 parent 3ec681a commit dc00fad

File tree

6 files changed

+14
-233
lines changed

6 files changed

+14
-233
lines changed

Dockerfile

+14-41
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,22 @@
11
FROM python:3.11-slim
22

3+
RUN mkdir -p /app && \
4+
cd /app && \
5+
apt update && \
6+
apt install -y git && \
7+
apt clean && \
8+
git clone https://github.com/rhasspy/piper && \
9+
cd piper && \
10+
rm -f .git
311

4-
# Set the working directory
5-
WORKDIR /app
6-
7-
# Get the latest version of the code
8-
RUN apt update && apt install -y git
9-
RUN git clone https://github.com/rhasspy/piper
10-
11-
# Update pip and install the required packages
12-
RUN pip install --upgrade pip
13-
14-
# Set the working directory
1512
WORKDIR /app/piper/src/python_run
1613

17-
# Install the package
18-
RUN pip install -e .
19-
20-
# Install the requirements
21-
RUN pip install -r requirements.txt
14+
RUN pip install --no-cache-dir --upgrade pip && \
15+
pip install --no-cache-dir -e . && \
16+
pip install --no-cache-dir -r requirements.txt && \
17+
pip install --no-cache-dir -r requirements_http.txt && \
18+
pip install --no-cache-dir wget
2219

23-
# Install http server
24-
RUN pip install -r requirements_http.txt
25-
26-
# Install wget pip package
27-
RUN pip install wget
28-
29-
# Copy the run.py file into the container
30-
COPY run.py /app
31-
# Copy the download folder into the container
32-
COPY download /app/download
33-
34-
# Expose the port 5000
3520
EXPOSE 5000
3621

37-
CMD ["python", "-m", "piper.http_server", "-m", "/app/models/model.onnx"]
38-
39-
# # Create ENV that will be used in the run.py file to set the download link
40-
# ENV MODEL_DOWNLOAD_LINK="https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/de/de_DE/pavoque/low/de_DE-pavoque-low.onnx?download=true"
41-
#
42-
# # Create ENV that will be used in the run.py file to set the target folder
43-
# ENV MODEL_TARGET_FOLDER="/app/models"
44-
#
45-
# # Create ENV that will be used in the run.py file to set the speaker
46-
# ENV SPEAKER="0"
47-
#
48-
# # Run the webserver with python run.py
49-
# CMD python /app/run.py $MODEL_DOWNLOAD_LINK $MODEL_TARGET_FOLDER $SPEAKER
22+
CMD ["python", "-m", "piper.http_server", "-m", "/app/models/model.onnx"]

client/piper-tts.py

-45
This file was deleted.

download/download-model.py

-41
This file was deleted.

download/download-piper-voices.py

-36
This file was deleted.

download/getfile.py

-32
This file was deleted.

run.py

-38
This file was deleted.

0 commit comments

Comments
 (0)