Spaces:
Build error
Build error
Kartikeyssj2
commited on
Commit
•
d3c1426
1
Parent(s):
2642248
dfs
Browse files- Dockerfile +19 -8
Dockerfile
CHANGED
@@ -1,15 +1,26 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
6 |
|
|
|
|
|
7 |
|
8 |
-
|
9 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
RUN python download_models.py
|
|
|
|
|
12 |
ENV TRANSFORMERS_CACHE=/tmp/.cache
|
13 |
|
14 |
-
|
15 |
-
CMD ["uvicorn", "
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.11.7-slim
|
3 |
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
|
|
6 |
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
|
10 |
+
# Install system dependencies
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
libsndfile1 \
|
13 |
+
&& rm -rf /var/lib/apt/lists/*
|
14 |
+
|
15 |
+
# Install any needed packages specified in requirements.txt
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
RUN python download_models.py
|
19 |
+
|
20 |
+
# Define environment variable
|
21 |
ENV TRANSFORMERS_CACHE=/tmp/.cache
|
22 |
|
23 |
+
# Run app.py when the container launches
|
24 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
25 |
+
|
26 |
+
|