Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +19 -7
Dockerfile
CHANGED
@@ -1,16 +1,28 @@
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
|
4 |
-
ENV
|
|
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
WORKDIR /app
|
|
|
|
|
8 |
COPY . /app
|
9 |
|
10 |
-
|
11 |
-
RUN pip install --
|
12 |
-
https://download.pytorch.org/whl/cpu/torchvision-0.17.2%2Bcpu-cp310-cp310-linux_x86_64.whl
|
13 |
-
RUN pip install TTS==0.22.0 transformers flask sentencepiece numpy==1.22.0 scipy librosa==0.10.1 numba==0.57.1
|
14 |
|
|
|
15 |
EXPOSE 7860
|
|
|
|
|
16 |
CMD ["python", "app.py"]
|
|
|
|
1 |
+
# Use a lightweight base image with Python
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
+
# Install required system packages
|
9 |
+
RUN apt-get update && apt-get install -y \
|
10 |
+
ffmpeg \
|
11 |
+
&& apt-get clean \
|
12 |
+
&& rm -rf /var/lib/apt/lists/*
|
13 |
+
|
14 |
+
# Set the working directory
|
15 |
WORKDIR /app
|
16 |
+
|
17 |
+
# Copy app files
|
18 |
COPY . /app
|
19 |
|
20 |
+
# Install Python dependencies
|
21 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
22 |
|
23 |
+
# Expose the port used by Flask
|
24 |
EXPOSE 7860
|
25 |
+
|
26 |
+
# Start the Flask app
|
27 |
CMD ["python", "app.py"]
|
28 |
+
|