riu-rd commited on
Commit
c933592
·
verified ·
1 Parent(s): 4c6579e

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -29
Dockerfile CHANGED
@@ -1,29 +1,29 @@
1
- FROM python:3.9.18
2
-
3
- WORKDIR /
4
-
5
- # Copy requirements.txt to the container
6
- COPY requirements.txt ./
7
-
8
- # Install Python dependencies
9
- RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Add a non-root user to run the application
12
- RUN useradd -m -u 1000 user
13
-
14
- # Set the user and home directory environment variables
15
- USER user
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
18
-
19
- # Create the application directory
20
- WORKDIR $HOME/app
21
-
22
- # Copy the application code and model files
23
- COPY --chown=user . $HOME/app/
24
-
25
- # Expose the port the FastAPI app runs on
26
- EXPOSE 7860
27
-
28
- # Command to run the FastAPI app
29
- CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.9.18
2
+
3
+ WORKDIR /
4
+
5
+ # Copy requirements.txt to the container
6
+ COPY requirements.txt ./
7
+
8
+ # Install Python dependencies
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ # Add a non-root user to run the application
12
+ RUN useradd -m -u 1000 user
13
+
14
+ # Set the user and home directory environment variables
15
+ USER user
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ # Create the application directory
20
+ WORKDIR $HOME/app
21
+
22
+ # Copy the application code and model files
23
+ COPY --chown=user . $HOME/app/
24
+
25
+ # Expose the port the FastAPI app runs on
26
+ EXPOSE 7860
27
+
28
+ # Command to run the FastAPI app
29
+ CMD ["uvicorn", "safety_classifier:app", "--host", "0.0.0.0", "--port", "7860"]