Estherrr777 commited on
Commit
f42f9ee
·
verified ·
1 Parent(s): 6b24d30

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -7
Dockerfile CHANGED
@@ -1,20 +1,23 @@
1
- # Use Python base
2
- FROM python:3.10
3
 
4
  # Set up user
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
- # Set work directory
10
  WORKDIR /app
11
 
12
- # Install backend dependencies
13
  COPY --chown=user backend/requirements.txt ./requirements.txt
14
- RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy the entire project
17
  COPY --chown=user . .
18
 
19
- # IMPORTANT: Use dot notation, not slashes
 
 
 
20
  CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM python:3.10-slim
 
2
 
3
  # Set up user
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV PATH="/home/user/.local/bin:$PATH"
7
 
8
+ # Set working directory
9
  WORKDIR /app
10
 
11
+ # Upgrade pip and install requirements
12
  COPY --chown=user backend/requirements.txt ./requirements.txt
13
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Copy the full project code (backend and data)
16
  COPY --chown=user . .
17
 
18
+ # Expose default FastAPI port
19
+ EXPOSE 7860
20
+
21
+ # Run FastAPI app
22
  CMD ["uvicorn", "backend.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
23
+