File size: 863 Bytes
f5ec497
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88ace6f
f5ec497
 
 
 
 
717a81d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.11-slim

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PORT=8000

# Install dependencies
RUN apt-get update && apt-get install -y gcc curl && rm -rf /var/lib/apt/lists/*

# Copy source code first
COPY ttsfm/ ./ttsfm/
COPY ttsfm-web/ ./ttsfm-web/
COPY pyproject.toml ./
COPY requirements.txt ./

# Install the TTSFM package with web dependencies
RUN pip install --no-cache-dir -e .[web]

# Install additional web dependencies
RUN pip install --no-cache-dir python-dotenv>=1.0.0

# Create non-root user
RUN useradd --create-home ttsfm && chown -R ttsfm:ttsfm /app
USER ttsfm

EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
    CMD curl -f http://localhost:8000/api/health || exit 1

WORKDIR /app/ttsfm-web
CMD ["python", "-m", "waitress", "--host=0.0.0.0", "--port=7860", "app:app"]