Spaces:
Sleeping

File size: 779 Bytes
8792f45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6dab5dc
8792f45
 
 
 
 
 
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
# Use an official lightweight Python runtime
FROM python:3.10-slim

# Set system environment variables to prevent Python from writing pyc files and buffering logs
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PORT=7860

# Set the working directory inside the container
WORKDIR /app

# Install required pip packages directly
# No need for a separate requirements.txt file, keeping deployment simple
RUN pip install --no-cache-dir \
    fastapi \
    uvicorn \
    pydantic \
    edge-tts

# Copy your server script into the container
# Ensure your python script is named 'server.py' in your repository
COPY app.py /app/app.py

# Expose the internal Hugging Face port
EXPOSE 7860

# Run the FastAPI application using Uvicorn on container startup
CMD ["python", "app.py"]