theoracle commited on
Commit
3a9ed92
·
verified ·
1 Parent(s): 573502b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python base image
2
+ FROM python:3.9
3
+
4
+ # Create a non-root user
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+
8
+ # Set up the path
9
+ ENV PATH="/home/user/.local/bin:$PATH"
10
+
11
+ # Set the working directory
12
+ WORKDIR /app
13
+
14
+ # Install Python dependencies
15
+ COPY --chown=user ./requirements.txt requirements.txt
16
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
17
+
18
+ # Copy the rest of the app
19
+ COPY --chown=user . /app
20
+
21
+ # Start the FastAPI app using Uvicorn
22
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]