chenguittiMaroua commited on
Commit
64a18a3
·
verified ·
1 Parent(s): 5a3c6fb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -20
Dockerfile CHANGED
@@ -1,20 +1,28 @@
1
- FROM python:3.10
2
-
3
- WORKDIR /ASF
4
-
5
- COPY ./requirements.txt /ASF/requirements.txt
6
-
7
- RUN pip install --no-cache-dir --upgrade -r /ASF/requirements.txt
8
-
9
- RUN useradd user
10
-
11
- USER user
12
-
13
- ENV HOME=/home/user \
14
- PATH=/home/user/.local/bin:$PATH
15
-
16
- WORKDIR $HOME/app
17
-
18
- COPY --chown=user . $HOME/app
19
-
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10
2
+
3
+ # Set the working directory inside the container
4
+ WORKDIR /ASF
5
+
6
+ # Copy the requirements file and install dependencies
7
+ COPY ./requirements.txt /ASF/requirements.txt
8
+ RUN pip install --no-cache-dir --upgrade -r /ASF/requirements.txt
9
+
10
+ # Create a user and switch to it
11
+ RUN useradd user
12
+ USER user
13
+
14
+ # Set environment variables
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+
18
+ # Set the working directory for the app
19
+ WORKDIR $HOME/app
20
+
21
+ # Copy the application code into the container
22
+ COPY --chown=user . $HOME/app
23
+
24
+ # Ensure the templates folder is copied (make sure it exists in your local project structure)
25
+ COPY ./templates /home/user/app/templates
26
+
27
+ # Set the command to run the FastAPI app
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]