umangchaudhry commited on
Commit
242223f
·
verified ·
1 Parent(s): 884c04a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -8
Dockerfile CHANGED
@@ -1,20 +1,42 @@
1
- FROM python:3.13.5-slim
 
2
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- curl \
8
- git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
 
14
- RUN pip3 install -r requirements.txt
 
15
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  EXPOSE 8501
17
 
 
 
 
 
 
 
18
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
19
 
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
1
+ # Use Python 3.11 slim image for smaller size
2
+ FROM python:3.11-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
+ gcc \
10
+ g++ \
 
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Copy requirements first for better caching
14
+ COPY requirements.txt .
15
 
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Install additional dependencies for Hugging Face datasets
20
+ RUN pip install --no-cache-dir datasets huggingface_hub
21
+
22
+ # Copy application files
23
+ COPY streamlit_app.py .
24
+ COPY constants.py .
25
+ COPY vaill_logo.png .
26
+
27
+ # Create necessary directories
28
+ RUN mkdir -p app_logs
29
+
30
+ # Expose port
31
  EXPOSE 8501
32
 
33
+ # Set environment variables
34
+ ENV PYTHONPATH=/app
35
+ ENV STREAMLIT_SERVER_PORT=8501
36
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
37
+
38
+ # Health check
39
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
40
 
41
+ # Run the app
42
+ CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]