AbosamraOnFire13 commited on
Commit
ba54652
·
verified ·
1 Parent(s): 34ca5ce

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -6
Dockerfile CHANGED
@@ -1,17 +1,26 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
 
 
 
 
 
 
 
 
6
  RUN useradd -m -u 1000 user
7
  USER user
8
  ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
  WORKDIR /app
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
 
13
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
 
15
  COPY --chown=user . /app
16
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
17
-
 
 
1
+ # Use Python 3.9 base image
 
 
2
  FROM python:3.9
3
 
4
+ # Install system dependencies first (as root)
5
+ RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ libsndfile1 \
8
+ ffmpeg \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # Create non-root user
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV PATH="/home/user/.local/bin:$PATH"
15
 
16
  WORKDIR /app
17
 
18
+ # Install Python dependencies
19
+ COPY --chown=user requirements.txt requirements.txt
20
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
21
 
22
+ # Copy application files
23
  COPY --chown=user . /app
24
+
25
+ # Run the API
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]