ROSHANNN123 commited on
Commit
690ba94
·
verified ·
1 Parent(s): f56db59

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -26
Dockerfile CHANGED
@@ -1,26 +1,13 @@
1
- # Use accurate Python image
2
- FROM python:3.9
3
-
4
- # Set working directory to user's home (Hugging Face requirement for permissions)
5
- WORKDIR /code
6
-
7
- # Copy requirements file first to leverage cache
8
- COPY ./requirements.txt /code/requirements.txt
9
-
10
- # Install dependencies
11
- # Upgrade pip to avoid issues
12
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
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"]