Sof22 commited on
Commit
72afbd6
1 Parent(s): a3690a8

Adding main docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # Use the official Python 3.10 image
3
+ FROM python:3.10-slim
4
+
5
+
6
+ # Install FFmpeg
7
+ RUN apt-get update && apt-get install -y ffmpeg
8
+
9
+ # Set the working directory to /code
10
+ WORKDIR /code
11
+
12
+ # Copy the current directory contents into the container at /code
13
+ COPY ./requirements.txt /code/requirements.txt
14
+
15
+ # Install requirements.txt
16
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
+
18
+ # Set up a new user named "user" with user ID 1000
19
+ RUN useradd -m -u 1000 user
20
+ # Switch to the "user" user
21
+ USER user
22
+ # Set home to the user's home directory
23
+ ENV HOME=/home/user \
24
+ PATH=/home/user/.local/bin:$PATH
25
+
26
+ # Set the working directory to the user's home directory
27
+ WORKDIR $HOME
28
+
29
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
30
+ COPY --chown=user . $HOME
31
+
32
+ # Start the FastAPI app on port 7860, the default port expected by Spaces
33
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]