Spanicin commited on
Commit
c2bc1da
·
verified ·
1 Parent(s): deff70e

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9.13
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && \
6
+ apt-get install -y \
7
+ ffmpeg \
8
+ libgl1 \
9
+ && apt-get clean \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Set up user
13
+ RUN useradd -m -u 1000 user
14
+ USER user
15
+
16
+ # Set environment variables
17
+ ENV HOME=/home/user \
18
+ PATH=/home/user/.local/bin:$PATH \
19
+ NUMBA_CACHE_DIR=/tmp/numba_cache
20
+
21
+ # Set working directory
22
+ WORKDIR $HOME/app
23
+
24
+ # Copy project files
25
+ COPY --chown=user . $HOME/app
26
+
27
+ # Install Python dependencies
28
+ RUN pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Install Hugging Face CLI and download model checkpoints
31
+ RUN pip install huggingface_hub && \
32
+ huggingface-cli download ByteDance/LatentSync --local-dir checkpoints --exclude "*.git*" "README.md" --include "latentsync_unet.pt" "whisper/tiny.pt"
33
+
34
+ # Expose port
35
+ EXPOSE 7860
36
+
37
+ # Start the application with Gunicorn
38
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "app:app"]