MalikShehram commited on
Commit
a16bd5c
·
verified ·
1 Parent(s): b68d8c4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.9 image
2
+ FROM python:3.9
3
+
4
+ # Set the working directory
5
+ WORKDIR /code
6
+
7
+ # Copy requirements and install dependencies
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
+
11
+ # Copy the application code
12
+ COPY . /code
13
+
14
+ # Create a non-root user (security requirement for HF Spaces)
15
+ RUN useradd -m -u 1000 user
16
+ USER user
17
+ ENV HOME=/home/user \
18
+ PATH=/home/user/.local/bin:$PATH
19
+
20
+ # Expose the Gradio port
21
+ EXPOSE 7860
22
+
23
+ # Command to run the application
24
+ CMD ["python", "app.py"]