marium-a commited on
Commit
4e422e8
·
verified ·
1 Parent(s): ef48749

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Set up a new user named "user" to match Hugging Face security rules
4
+ RUN useradd -m -u 1000 user
5
+ USER user
6
+ ENV HOME=/home/user \
7
+ PATH=/home/user/.local/bin:$PATH
8
+
9
+ # Set the working directory inside the container
10
+ WORKDIR $HOME/app
11
+
12
+ # Install Gradio directly on the Hugging Face server
13
+ RUN pip install --no-cache-dir gradio
14
+
15
+ # Copy the app files into the container
16
+ COPY --chown=user . $HOME/app
17
+
18
+ # Inform Docker that the container listens on port 7860
19
+ EXPOSE 7860
20
+
21
+ # Run the python app when the container starts
22
+ CMD ["python", "app.py"]