leo861 commited on
Commit
f8589c5
·
verified ·
1 Parent(s): 04229b7

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ libsndfile1 \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV PATH="/home/user/.local/bin:$PATH"
11
+
12
+ WORKDIR /app
13
+
14
+ # Create cache directory
15
+ RUN mkdir -p /home/user/.cache/huggingface/hub
16
+
17
+ # Copy requirements first to leverage Docker cache
18
+ COPY --chown=user requirements.txt requirements.txt
19
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
20
+
21
+ # Copy the rest of the application
22
+ COPY --chown=user . /app
23
+
24
+ # Set environment variables
25
+ ENV HF_HOME=/home/user/.cache/huggingface
26
+
27
+ # Expose the port the app runs on
28
+ EXPOSE 7860
29
+
30
+ # Command to run the application
31
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]