yashpinjarkar10 commited on
Commit
94510bd
·
verified ·
1 Parent(s): e9da779

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -14
Dockerfile CHANGED
@@ -1,14 +1,24 @@
1
- FROM python:3.10-slim
2
-
3
- RUN useradd user
4
- USER user
5
- ENV HOME=/home/user \
6
- PATH=/home/user/.local/bin:$PATH
7
-
8
- WORKDIR $HOME/app
9
-
10
- COPY --chown=user ./ $HOME/app
11
-
12
- RUN pip install -r requirements.txt
13
-
14
- CMD fastapi run --reload --host=0.0.0.0 --port=7860
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Create a non-root user
4
+ RUN useradd user
5
+ USER user
6
+
7
+ # Set environment variables
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH
10
+
11
+ # Set the working directory
12
+ WORKDIR $HOME/app
13
+
14
+ # Copy the application files
15
+ COPY --chown=user . $HOME/app
16
+
17
+ # Install dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Expose the port the app will run on
21
+ EXPOSE 7860
22
+
23
+ # Run the FastAPI app using uvicorn
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]