randusertry commited on
Commit
0703532
·
verified ·
1 Parent(s): a82d5b4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -15
Dockerfile CHANGED
@@ -1,33 +1,29 @@
1
  FROM python:3.10-slim
2
 
3
- # System deps: Added ffmpeg and libsndfile1 for audio processing
4
  RUN apt-get update && apt-get install -y \
5
- build-essential \
6
- libxml2 \
7
- libxslt1-dev \
8
- zlib1g-dev \
9
- pandoc \
10
  ffmpeg \
11
  libsndfile1 \
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Create a non-root user for Hugging Face
15
  RUN useradd -m -u 1000 user
 
 
 
16
  USER user
17
  ENV PATH="/home/user/.local/bin:${PATH}"
18
 
19
- WORKDIR /app
20
-
21
- # Copy requirements and install
22
  COPY --chown=user requirements.txt .
23
- RUN pip install --no-cache-dir -r requirements.txt
24
- RUN pip install --no-cache-dir "markitdown[all]"
25
 
26
- # Copy the rest of the app with correct ownership
27
  COPY --chown=user . .
28
 
29
- # Expose FastAPI port
30
  EXPOSE 7860
31
 
32
- # Run app
33
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Install system dependencies for audio and phonemization
4
  RUN apt-get update && apt-get install -y \
 
 
 
 
 
5
  ffmpeg \
6
  libsndfile1 \
7
+ espeak-ng \
8
+ build-essential \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Set up a non-root user (Hugging Face Requirement)
12
  RUN useradd -m -u 1000 user
13
+ WORKDIR /app
14
+
15
+ # Switch to user context
16
  USER user
17
  ENV PATH="/home/user/.local/bin:${PATH}"
18
 
19
+ # Install Python requirements
 
 
20
  COPY --chown=user requirements.txt .
21
+ RUN pip install --no-cache-dir --user -r requirements.txt
 
22
 
23
+ # Copy your application code
24
  COPY --chown=user . .
25
 
26
+ # Expose port 7860 for HF Spaces
27
  EXPOSE 7860
28
 
 
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]