Skip to content

Commit d633fbf

Browse files
committed
Add build
1 parent 5023f2b commit d633fbf

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

.github/workflows/docker.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build & Push Docker (GHCR)
2+
3+
on:
4+
push:
5+
branches: [main] # change if your default branch is different
6+
tags: ["v*.*.*"] # semver tags trigger a release image
7+
workflow_dispatch: # allow manual run
8+
9+
permissions:
10+
contents: read
11+
packages: write # required to push to GHCR
12+
13+
jobs:
14+
docker:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up QEMU (for multi-arch)
22+
uses: docker/setup-qemu-action@v3
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to GHCR
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata (tags, labels)
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ghcr.io/${{ github.repository }}
39+
tags: |
40+
type=ref,event=branch
41+
type=ref,event=tag
42+
type=sha
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
45+
- name: Build and push
46+
uses: docker/build-push-action@v6
47+
with:
48+
context: .
49+
push: true
50+
# Build both amd64 and arm64 (change if you only need one)
51+
platforms: linux/amd64,linux/arm64
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}
54+
cache-from: type=gha
55+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM python:3.10-slim AS base
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
tini ca-certificates \
5+
&& rm -rf /var/lib/apt/lists/*
6+
7+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh -s -- --yes --bin-dir /usr/local/bin
8+
9+
WORKDIR /app
10+
11+
COPY pyproject.toml uv.lock* ./
12+
13+
RUN uv sync --frozen --no-dev
14+
15+
COPY . .
16+
17+
ENV PATH="/app/.venv/bin:${PATH}"
18+
19+
ENV PYTHONUNBUFFERED=1
20+
21+
EXPOSE 10200
22+
23+
ENV THTTS_LOG_LEVEL=DEBUG
24+
ENV THTTS_HOST=0.0.0.0
25+
ENV THTTS_PORT=10200
26+
ENV THTTS_MODEL=VIZINTZOR/MMS-TTS-THAI-FEMALEV2
27+
28+
ENTRYPOINT ["/usr/bin/tini", "--", "./entrypoint.sh"]

entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
exec uv run python src/wyoming_thai_vits.py \
5+
--log-level "${WY_LOG_LEVEL}" \
6+
--host "${WY_HOST}" \
7+
--port "${WY_PORT}" \
8+
--model-id "${WY_MODEL}"

0 commit comments

Comments
 (0)