Upload 4 files
Browse files- .dockerignore +27 -0
- .env +3 -0
- Dockerfile +30 -0
- docker-compose.yml +20 -0
.dockerignore
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**/__pycache__
|
2 |
+
**/.venv
|
3 |
+
**/.classpath
|
4 |
+
**/.dockerignore
|
5 |
+
**/.env
|
6 |
+
**/.git
|
7 |
+
**/.gitignore
|
8 |
+
**/.project
|
9 |
+
**/.settings
|
10 |
+
**/.toolstarget
|
11 |
+
**/.vs
|
12 |
+
**/.vscode
|
13 |
+
**/*.*proj.user
|
14 |
+
**/*.dbmdl
|
15 |
+
**/*.jfm
|
16 |
+
**/bin
|
17 |
+
**/charts
|
18 |
+
**/docker-compose*
|
19 |
+
**/compose*
|
20 |
+
**/Dockerfile*
|
21 |
+
**/node_modules
|
22 |
+
**/npm-debug.log
|
23 |
+
**/obj
|
24 |
+
**/secrets.dev.yaml
|
25 |
+
**/values.dev.yaml
|
26 |
+
LICENSE
|
27 |
+
README.md
|
.env
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
CONTAINER_PORT=7860
|
2 |
+
HOST_PORT=7860
|
3 |
+
SPEAKER_FOLDER="/app/speakers"
|
Dockerfile
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official NVIDIA base image with CUDA support
|
2 |
+
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
3 |
+
|
4 |
+
# Set label for the docker image description
|
5 |
+
LABEL description="Docker image for xtts-api-server"
|
6 |
+
|
7 |
+
# Install required packages (avoid cache to reduce image size)
|
8 |
+
RUN apt-get update && \
|
9 |
+
apt-get install --no-install-recommends -y \
|
10 |
+
python3-dev portaudio19-dev libportaudio2 libasound2-dev libportaudiocpp0 \
|
11 |
+
git python3 python3-pip make g++ ffmpeg && \
|
12 |
+
rm -rf /var/lib/apt/lists/*
|
13 |
+
|
14 |
+
# Upgrade pip and install virtualenv
|
15 |
+
RUN python3 -m pip install --upgrade pip setuptools wheel ninja virtualenv
|
16 |
+
|
17 |
+
# Copy the application source code to /app directory and change the workdir to /app
|
18 |
+
# COPY . /app
|
19 |
+
# WORKDIR /app
|
20 |
+
|
21 |
+
# Install Python dependencies
|
22 |
+
RUN pip install torch torchaudio --index-url https://download.pytorch.org/whl/cu121
|
23 |
+
RUN pip install deepspeed
|
24 |
+
RUN pip install xtts-api-server
|
25 |
+
|
26 |
+
# Expose the container ports
|
27 |
+
EXPOSE 8020
|
28 |
+
|
29 |
+
# Run xtts_api_server when the container starts
|
30 |
+
CMD ["bash", "-c", "python3 -m xtts_api_server --listen -p 8020 -t 'http://localhost:8020' -sf 'xtts-server/speakers' -o 'xtts-server/output' -mf 'xtts-server/models' --deepspeed"]
|
docker-compose.yml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
version: '3.4'
|
2 |
+
|
3 |
+
services:
|
4 |
+
xttsapiserver:
|
5 |
+
image: xttsapiserver
|
6 |
+
env_file: .env
|
7 |
+
build:
|
8 |
+
context: ..
|
9 |
+
dockerfile: ./docker/Dockerfile
|
10 |
+
ports:
|
11 |
+
- "${HOST_PORT:-8020}:${CONTAINER_PORT:-8020}"
|
12 |
+
volumes:
|
13 |
+
- ./xtts-server:/xtts-server
|
14 |
+
deploy:
|
15 |
+
resources:
|
16 |
+
reservations:
|
17 |
+
devices:
|
18 |
+
- driver: nvidia
|
19 |
+
device_ids: ['0']
|
20 |
+
capabilities: [gpu]
|