Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -26
Dockerfile
CHANGED
|
@@ -1,26 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# Copy the rest of the application
|
| 15 |
-
COPY . /code
|
| 16 |
-
|
| 17 |
-
# Create a writable directory for standard cache if needed (though we use /tmp usually)
|
| 18 |
-
# and set permissions for the user 'user' (ID 1000) which HF uses.
|
| 19 |
-
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
|
| 20 |
-
ENV XDG_CACHE_HOME=/code/cache
|
| 21 |
-
|
| 22 |
-
# Expose the port (Hugging Face expects port 7860)
|
| 23 |
-
EXPOSE 7860
|
| 24 |
-
|
| 25 |
-
# Command to start the uvicorn server on port 7860
|
| 26 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
WORKDIR /code
|
| 3 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 4 |
+
|
| 5 |
+
# INSTALL AUDIO DRIVERS
|
| 6 |
+
RUN apt-get update && apt-get install -y libsndfile1 ffmpeg && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 9 |
+
COPY . /code
|
| 10 |
+
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
|
| 11 |
+
ENV XDG_CACHE_HOME=/code/cache
|
| 12 |
+
EXPOSE 7860
|
| 13 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|