anuj-exe commited on
Commit
6e3d87c
·
verified ·
1 Parent(s): 662a1bb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -1,16 +1,22 @@
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies for audio
4
  RUN apt-get update && apt-get install -y git ffmpeg libsndfile1
5
 
 
 
 
 
 
 
6
  WORKDIR /app
7
 
8
  # Install Python dependencies
9
- COPY requirements.txt .
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
  # Copy app code
13
- COPY . /app
14
 
15
  # Run FastAPI app
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies
4
  RUN apt-get update && apt-get install -y git ffmpeg libsndfile1
5
 
6
+ # Create user and writable cache directory
7
+ RUN useradd -m user
8
+ USER user
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
+ ENV HF_HOME="/home/user/.cache/huggingface"
11
+
12
  WORKDIR /app
13
 
14
  # Install Python dependencies
15
+ COPY --chown=user requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Copy app code
19
+ COPY --chown=user . /app
20
 
21
  # Run FastAPI app
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]