fred72721979 commited on
Commit
77c295f
·
verified ·
1 Parent(s): 7f956a0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a Python 3.10 base image (compatible with CrewAI)
2
+ FROM python:3.10
3
+
4
+ # Set the working directory
5
+ WORKDIR /code
6
+
7
+ # Copy requirements.txt into the container
8
+ COPY ./requirements.txt /code/requirements.txt
9
+
10
+ # Install dependencies without caching
11
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
12
+
13
+ # Set up a new user named "user" with user ID 1000
14
+ RUN useradd -m -u 1000 user
15
+
16
+ # Switch to the "user" user
17
+ USER user
18
+
19
+ # Set environment variables for Hugging Face Spaces and Gradio
20
+ ENV HOME=/home/user \
21
+ PATH=/home/user/.local/bin:$PATH \
22
+ PYTHONPATH=$HOME/app \
23
+ PYTHONUNBUFFERED=1 \
24
+ GRADIO_ALLOW_FLAGGING=never \
25
+ GRADIO_NUM_PORTS=1 \
26
+ GRADIO_SERVER_NAME=0.0.0.0 \
27
+ GRADIO_THEME=huggingface \
28
+ SYSTEM=spaces
29
+
30
+ # Set the working directory to the user's home directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Copy all project files into the container, setting ownership to "user"
34
+ COPY --chown=user . $HOME/app
35
+
36
+ # Define the command to run your Gradio app
37
+ CMD ["python", "app.py"]