Chrunos commited on
Commit
7c1dce6
·
verified ·
1 Parent(s): f68ef50

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Create a non-root user
7
+ RUN useradd -m -u 1000 user
8
+ # Install FFmpeg as root
9
+ USER root
10
+ RUN apt-get update && apt-get install -y ffmpeg
11
+
12
+ # Switch to the non-root user
13
+ USER user
14
+ ENV PATH="/home/user/.local/bin:$PATH"
15
+
16
+ # Set the working directory
17
+ WORKDIR /app
18
+
19
+ # 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 files
24
+ COPY --chown=user . /app
25
+
26
+ # Command to run the application
27
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]