Update Dockerfile
Browse files- Dockerfile +17 -3
Dockerfile
CHANGED
|
@@ -1,5 +1,19 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
|
@@ -8,7 +22,7 @@ WORKDIR /app
|
|
| 8 |
COPY . .
|
| 9 |
|
| 10 |
# Install Python dependencies
|
| 11 |
-
RUN pip install --no-cache-dir
|
| 12 |
-
|
| 13 |
|
|
|
|
| 14 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
ARG BASE=nvidia/cuda:11.8.0-base-ubuntu22.04
|
| 2 |
+
FROM ${BASE}
|
| 3 |
|
| 4 |
+
# Install OS dependencies:
|
| 5 |
+
RUN apt-get update && apt-get upgrade -y \
|
| 6 |
+
&& apt-get install -y --no-install-recommends \
|
| 7 |
+
gcc g++ \
|
| 8 |
+
make \
|
| 9 |
+
python3 python3-dev python3-pip python3-venv python3-wheel \
|
| 10 |
+
espeak-ng libsndfile1-dev \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# Install Major Python Dependencies:
|
| 14 |
+
RUN pip3 install llvmlite --ignore-installed \
|
| 15 |
+
&& pip3 install torch torchaudio --extra-index-url https://download.pytorch.org/whl/cu118 \
|
| 16 |
+
&& rm -rf /root/.cache/pip
|
| 17 |
|
| 18 |
# Set the working directory
|
| 19 |
WORKDIR /app
|
|
|
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
# Install Python dependencies
|
| 25 |
+
RUN pip install --no-cache-dir --user -r requirements.txt
|
|
|
|
| 26 |
|
| 27 |
+
# Command to run the application
|
| 28 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|