mirror of https://github.com/coqui-ai/TTS.git
Add Dockerfile and build/push CI
parent
164c7dd676
commit
27fcb5dabf
|
@ -1 +1,2 @@
|
||||||
.git/
|
.git/
|
||||||
|
Dockerfile
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
name: "Docker build and push"
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- dev
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
jobs:
|
||||||
|
docker-build:
|
||||||
|
name: "Build and push Docker image"
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: ["amd64"]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Compute Docker tags, check VERSION file matches tag
|
||||||
|
id: compute-tag
|
||||||
|
run: |
|
||||||
|
set -ex
|
||||||
|
base="ghcr.io/coqui-ai/tts"
|
||||||
|
tags="" # PR build
|
||||||
|
if [[ "${{ startsWith(github.ref, 'refs/heads/') }}" = "true" ]]; then
|
||||||
|
# Push to branch
|
||||||
|
github_ref="${{ github.ref }}"
|
||||||
|
branch=${github_ref#*refs/heads/} # strip prefix to get branch name
|
||||||
|
tags="${base}:${branch},${base}:${{ github.sha }},"
|
||||||
|
elif [[ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]]; then
|
||||||
|
VERSION="v$(cat TTS/VERSION)"
|
||||||
|
if [[ "${{ github.ref }}" != "refs/tags/${VERSION}" ]]; then
|
||||||
|
echo "Pushed tag does not match VERSION file. Aborting push."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
tags="${base}:${VERSION},${base}:latest,${base}:${{ github.sha }}"
|
||||||
|
fi
|
||||||
|
echo "::set-output name=tags::${tags}"
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v1
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
platforms: linux/${{ matrix.arch }}
|
||||||
|
push: ${{ github.event_name == 'push' }}
|
||||||
|
tags: ${{ steps.compute-tag.outputs.tags }}
|
|
@ -0,0 +1,11 @@
|
||||||
|
FROM nvcr.io/nvidia/pytorch:22.03-py3
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends espeak && rm -rf /var/lib/apt/lists/*
|
||||||
|
WORKDIR /root
|
||||||
|
COPY requirements.txt /root
|
||||||
|
COPY requirements.dev.txt /root
|
||||||
|
COPY requirements.notebooks.txt /root
|
||||||
|
RUN pip install -r <(cat requirements.txt requirements.dev.txt requirements.notebooks.txt)
|
||||||
|
COPY . /root
|
||||||
|
RUN make install
|
||||||
|
ENTRYPOINT ["tts"]
|
||||||
|
CMD ["--help"]
|
Loading…
Reference in New Issue