Chrunos commited on
Commit
89de18a
·
verified ·
1 Parent(s): 4029991

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ FROM python:3.12
3
+
4
+ # Install FFmpeg
5
+ RUN apt-get update && apt-get install -y ffmpeg
6
+
7
+ # Create a non - root user
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV PATH="/home/user/.local/bin:$PATH"
11
+
12
+ # Set the working directory
13
+ WORKDIR /app
14
+
15
+ # Copy the requirements file
16
+ COPY --chown=user ./requirements.txt requirements.txt
17
+
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
20
+
21
+ # Copy all other files to the working directory
22
+ COPY --chown=user . /app
23
+
24
+ # Set appropriate permissions for all files and directories in the app
25
+ RUN find /app -type f -exec chmod 644 {} \; && \
26
+ find /app -type d -exec chmod 755 {} \;
27
+
28
+ # Start the application using Uvicorn
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]