VihaanShinde10 commited on
Commit
8fff8ea
·
1 Parent(s): 3d74fa1

chore: optimize Docker for monorepo and move to root

Browse files
backend/.dockerignore → .dockerignore RENAMED
File without changes
backend/Dockerfile → Dockerfile RENAMED
@@ -17,12 +17,12 @@ RUN useradd -m -u 1000 user
17
  USER user
18
  WORKDIR $HOME/app
19
 
20
- # Copy requirements first to leverage Docker cache
21
- COPY --chown=user requirements.txt .
22
  RUN pip install --user -r requirements.txt
23
 
24
- # Copy the rest of the code
25
- COPY --chown=user . .
26
 
27
  # Ensure data directories exist
28
  RUN mkdir -p data/models data/faiss_index
@@ -33,5 +33,5 @@ ENV PATH="/home/user/.local/bin:${PATH}"
33
  # Expose Hugging Face's default port
34
  EXPOSE 7860
35
 
36
- # Startup command
37
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
17
  USER user
18
  WORKDIR $HOME/app
19
 
20
+ # Copy requirements first
21
+ COPY --chown=user backend/requirements.txt .
22
  RUN pip install --user -r requirements.txt
23
 
24
+ # Copy only the backend folder contents to the container root
25
+ COPY --chown=user backend/ .
26
 
27
  # Ensure data directories exist
28
  RUN mkdir -p data/models data/faiss_index
 
33
  # Expose Hugging Face's default port
34
  EXPOSE 7860
35
 
36
+ # Startup command (app.main:app works because we copied the CONTENTS of backend/)
37
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]