Chrunos commited on
Commit
c00c1bf
·
verified ·
1 Parent(s): 8ad19ea

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11
2
+
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 user
5
+ # Install FFmpeg as root
6
+ USER root
7
+ RUN apt-get update && apt-get install -y ffmpeg
8
+
9
+ # Switch to the non-root user
10
+ USER user
11
+ ENV PATH="/home/user/.local/bin:$PATH"
12
+
13
+ # Set the working directory
14
+ WORKDIR /app
15
+
16
+ # Install Python dependencies
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
+
20
+ # Copy application files
21
+ COPY --chown=user . /app
22
+
23
+ # Command to run the application
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]