bharathmunakala commited on
Commit
6a6389c
·
verified ·
1 Parent(s): 2f86d0b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 as the base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install uv as root
8
+ RUN pip install uv
9
+
10
+ # Copy requirements file
11
+ COPY requirements.txt .
12
+
13
+ # Install dependencies system-wide (as root)
14
+ RUN uv pip install --system -r requirements.txt
15
+
16
+ # Create a non-root user for running the application
17
+ RUN useradd -m -u 1000 user
18
+
19
+ # Create necessary directories for Chainlit and set permissions
20
+ RUN mkdir -p /app/.files /app/.cache && \
21
+ chown -R user:user /app
22
+
23
+ # Copy the application code and set proper ownership
24
+ COPY --chown=user . .
25
+
26
+ # Switch to the non-root user for running the application
27
+ USER user
28
+
29
+ # Expose the port for Hugging Face Spaces (required)
30
+ EXPOSE 7860
31
+
32
+ # Command to run the application on Hugging Face's required port
33
+ CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]