mindspark121 commited on
Commit
08eb8c5
·
verified ·
1 Parent(s): c4f53c6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official lightweight Python image
2
+ FROM python:3.9
3
+
4
+ # Create a user to run the application
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:$PATH"
8
+
9
+ WORKDIR /app
10
+
11
+ # Copy dependencies and install them
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # Copy the application code
16
+ COPY --chown=user . /app
17
+
18
+ # Run FastAPI using Uvicorn
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]