SAAHMATHWORKS commited on
Commit
d48aa10
Β·
1 Parent(s): 9ca3c48

dockerfile copy

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -10
Dockerfile CHANGED
@@ -1,6 +1,5 @@
1
  FROM python:3.11-slim
2
 
3
- # Set working directory
4
  WORKDIR /app
5
  ENV PYTHONPATH=/app:$PYTHONPATH
6
 
@@ -10,29 +9,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
10
  curl \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
- # Copy requirements and install them
14
- COPY requirements.txt .
15
  RUN pip install --no-cache-dir --upgrade pip && \
16
  pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy your entire project into the container
19
- COPY . .
20
 
21
- # Debug: List what was copied
22
  RUN echo "πŸ“ Contents of /app:" && ls -la && \
23
  echo "πŸ“ Contents of /app/models:" && ls -la models/ && \
24
  echo "πŸ“ Contents of /app/core:" && ls -la core/
25
 
26
- # Create and switch to non-root user
27
  RUN useradd -m -u 1000 user && chown -R user:user /app
28
  USER user
29
 
30
- # Expose port if you're running a web app (Gradio/FastAPI/etc.)
31
  EXPOSE 7860
32
 
33
- # Optional healthcheck
34
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
35
  CMD curl -f http://localhost:7860/health || exit 1
36
 
37
- # Run your main script
38
  CMD ["python", "app.py"]
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
  ENV PYTHONPATH=/app:$PYTHONPATH
5
 
 
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Copy and install dependencies
13
+ COPY MultiCountryRAG/requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade pip && \
15
  pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy project files (the important part)
18
+ COPY MultiCountryRAG/ .
19
 
20
+ # Debugging step (safe to keep)
21
  RUN echo "πŸ“ Contents of /app:" && ls -la && \
22
  echo "πŸ“ Contents of /app/models:" && ls -la models/ && \
23
  echo "πŸ“ Contents of /app/core:" && ls -la core/
24
 
25
+ # Create non-root user
26
  RUN useradd -m -u 1000 user && chown -R user:user /app
27
  USER user
28
 
 
29
  EXPOSE 7860
30
 
 
31
  HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
32
  CMD curl -f http://localhost:7860/health || exit 1
33
 
 
34
  CMD ["python", "app.py"]