Echo-ai commited on
Commit
d244e05
·
verified ·
1 Parent(s): 8314611

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -21
Dockerfile CHANGED
@@ -1,31 +1,23 @@
 
1
  FROM python:3.9-slim
2
- RUN apt-get update && apt-get install -y \
3
- gcc \
4
- python3-dev \
5
- curl \
6
- gnupg \
7
- libxml2-dev \
8
- libxslt-dev \
9
- && curl -sL https://deb.nodesource.com/setup_18.x | bash - \
10
- && apt-get install -y nodejs \
11
- && npm install -g playwright \
12
- && playwright install-deps chromium \
13
- && playwright install chromium
14
 
 
15
  WORKDIR /app
16
 
17
- RUN mkdir -p templates && \
18
- curl -L https://huggingface.co/datasets/gefiwek187/realtime-api/resolve/main/edge_tts-api.py -o api.py && \
19
- curl -L https://huggingface.co/datasets/gefiwek187/realtime-api/resolve/main/edge-tts-requirements.txt -o requirements.txt
 
20
 
 
 
 
21
 
 
22
  RUN pip install --no-cache-dir -r requirements.txt
23
- RUN pip install flask
24
-
25
-
26
- ENV PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright \
27
- PYTHONUNBUFFERED=1
28
 
 
29
  EXPOSE 7860
30
 
31
- CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "300"]
 
 
1
+ # Use a lightweight Python base image
2
  FROM python:3.9-slim
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies (e.g., for edge-tts or audio handling if needed)
8
+ RUN apt-get update && apt-get install -y \
9
+ wget \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Download the code and requirements from Hugging Face
13
+ RUN wget -O edge_tts-api.py "https://huggingface.co/datasets/gefiwek187/realtime-api/resolve/main/edge_tts-api.py" \
14
+ && wget -O requirements.txt "https://huggingface.co/datasets/gefiwek187/realtime-api/resolve/main/edge-tts-requirements.txt"
15
 
16
+ # Install Python dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
18
 
19
+ # Expose the port Hugging Face Spaces expects
20
  EXPOSE 7860
21
 
22
+ # Command to run the FastAPI app
23
+ CMD ["python", "edge_tts-api.py"]