Viraj0112 commited on
Commit
571cc16
·
verified ·
1 Parent(s): 88b06aa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -22
Dockerfile CHANGED
@@ -1,22 +1,26 @@
1
- FROM python:3.10-slim
2
-
3
- WORKDIR /app
4
-
5
- # Copy requirements first to cache dependencies
6
- COPY requirements.txt .
7
- RUN pip install --no-cache-dir -r requirements.txt
8
-
9
- # Copy the rest of the application
10
- COPY . .
11
-
12
- # Create a non-root user for security (Hugging Face requirement)
13
- RUN useradd -m -u 1000 user
14
- USER user
15
- ENV HOME=/home/user \
16
- PATH=/home/user/.local/bin:$PATH
17
-
18
- # Expose the port (Hugging Face expects port 7860)
19
- EXPOSE 8000
20
-
21
- # Start the application
22
- CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Set the working directory to /app for copying files
4
+ WORKDIR /app
5
+
6
+ # Copy requirements from the root of your project
7
+ COPY requirements.txt .
8
+ RUN pip install --no-cache-dir -r requirements.txt
9
+
10
+ # Copy the entire project (including backend folder) to /app
11
+ COPY . .
12
+
13
+ # Create a non-root user for security (Hugging Face requirement)
14
+ RUN useradd -m -u 1000 user
15
+ USER user
16
+ ENV HOME=/home/user \
17
+ PATH=/home/user/.local/bin:$PATH
18
+
19
+ # Switch working directory to /app/backend so imports (like 'from agents...') work
20
+ WORKDIR /app/backend
21
+
22
+ # Expose the port (Hugging Face expects port 7860)
23
+ EXPOSE 7860
24
+
25
+ # Start the application from the backend directory
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]