Make docker images lighter (#2149)

This commit is contained in:
Julian Weber 2022-11-15 00:11:32 +01:00 committed by GitHub
parent 7689fadd86
commit f85609f9bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 15 deletions

View File

@ -15,8 +15,8 @@ jobs:
matrix: matrix:
arch: ["amd64"] arch: ["amd64"]
base: base:
# - "nvcr.io/nvidia/pytorch:22.03-py3" # GPU enabled - "nvidia/cuda:11.8.0-base-ubuntu22.04" # GPU enabled
- "ubuntu:20.04" # CPU only - "python:3.10.8-slim" # CPU only
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Log in to the Container registry - name: Log in to the Container registry
@ -32,7 +32,7 @@ jobs:
base="ghcr.io/coqui-ai/tts" base="ghcr.io/coqui-ai/tts"
tags="" # PR build tags="" # PR build
if [[ ${{ matrix.base }} = "ubuntu:20.04" ]]; then if [[ ${{ matrix.base }} = "python:3.10.8-slim" ]]; then
base="ghcr.io/coqui-ai/tts-cpu" base="ghcr.io/coqui-ai/tts-cpu"
fi fi

View File

@ -1,20 +1,12 @@
ARG BASE=nvcr.io/nvidia/pytorch:22.03-py3 ARG BASE=nvidia/cuda:11.8.0-base-ubuntu22.04
FROM ${BASE} FROM ${BASE}
RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ make python3 python3-dev python3-pip python3-venv python3-wheel espeak espeak-ng libsndfile1-dev && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y --no-install-recommends gcc g++ make python3 python3-dev python3-pip python3-venv python3-wheel espeak-ng libsndfile1-dev && rm -rf /var/lib/apt/lists/*
RUN pip install llvmlite --ignore-installed RUN pip install llvmlite --ignore-installed
# Create and activate virtual env
ENV VIRTUAL_ENV=/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN pip install -U pip setuptools wheel
WORKDIR /root WORKDIR /root
COPY requirements.txt /root
COPY requirements.dev.txt /root
COPY requirements.notebooks.txt /root
RUN ["/bin/bash", "-c", "pip install -r <(cat requirements.txt requirements.dev.txt requirements.notebooks.txt)"]
COPY . /root COPY . /root
RUN pip3 install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu117
RUN make install RUN make install
ENTRYPOINT ["tts"] ENTRYPOINT ["tts"]
CMD ["--help"] CMD ["--help"]