mgbam commited on
Commit
6464bbf
·
verified ·
1 Parent(s): 5b1c962

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -6
Dockerfile CHANGED
@@ -1,16 +1,40 @@
 
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
- COPY requirements.txt ./
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
8
  COPY . .
9
 
10
- # Fix permissions issue for /.streamlit
11
- RUN mkdir -p /app/.streamlit && chmod -R 755 /app/.streamlit
12
-
13
- # Expose port for Streamlit
14
  EXPOSE 8501
15
 
16
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
 
1
+ # Start from a Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set work directory
9
  WORKDIR /app
10
 
11
+ # Install build tools and system dependencies
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ gcc \
15
+ g++ \
16
+ git \
17
+ curl \
18
+ wget \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ # Upgrade pip
22
+ RUN pip install --upgrade pip
23
+
24
+ # Install Python dependencies
25
+ COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt
27
 
28
+ # Copy app source
29
  COPY . .
30
 
31
+ # Expose Streamlit port
 
 
 
32
  EXPOSE 8501
33
 
34
+ # Set Streamlit to run on all interfaces
35
+ ENV STREAMLIT_SERVER_HEADLESS=true
36
+ ENV STREAMLIT_SERVER_PORT=8501
37
+ ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
38
+
39
+ # Default command to run the app
40
+ CMD ["streamlit", "run", "app.py"]