tedowski commited on
Commit
72e8a3d
·
verified ·
1 Parent(s): 73f9c53

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -4
Dockerfile CHANGED
@@ -1,16 +1,33 @@
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"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9
2
 
3
+ # Install system dependencies including ffmpeg
4
+ RUN apt-get update && \
5
+ apt-get install -y \
6
+ ffmpeg \
7
+ libsm6 \
8
+ libxext6 \
9
+ && apt-get clean \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Create user
13
  RUN useradd -m -u 1000 user
14
  USER user
15
  ENV PATH="/home/user/.local/bin:$PATH"
16
 
17
  WORKDIR /app
18
 
19
+ # Copy and install Python dependencies
20
  COPY --chown=user ./requirements.txt requirements.txt
21
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
22
 
23
+ # Copy application code
24
  COPY --chown=user . /app
25
+
26
+ # Create temp directory
27
+ RUN mkdir -p /tmp/audio_extractor
28
+
29
+ # Expose port
30
+ EXPOSE 7860
31
+
32
+ # Run the application
33
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]