Spaces:
Running
Running
Echo-ai
commited on
Update Dockerfile
Browse files- 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 |
-
|
18 |
-
|
19 |
-
|
|
|
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 |
-
|
|
|
|
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"]
|