crackuser commited on
Commit
15c243e
·
verified ·
1 Parent(s): fe8d173

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -16
Dockerfile CHANGED
@@ -3,39 +3,31 @@ FROM python:3.10-slim
3
  # Set working directory
4
  WORKDIR /app
5
 
6
- # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
 
8
  build-essential \
9
  curl \
10
- software-properties-common \
11
  git \
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Copy requirements first for better caching
15
  COPY requirements.txt .
16
 
17
  # Install Python dependencies
18
- RUN pip3 install --no-cache-dir -r requirements.txt
19
 
20
  # Copy application code
21
  COPY . .
22
 
23
- # Create non-root user for security
24
- RUN useradd -m -u 1000 streamlit
25
- USER streamlit
26
-
27
- # Expose port
28
  EXPOSE 8501
29
 
30
- # Configure Streamlit
31
  ENV STREAMLIT_SERVER_HEADLESS=true
32
  ENV STREAMLIT_SERVER_ENABLECORS=false
33
- ENV STREAMLIT_SERVER_ENABLEXSRFPROTECTION=false
34
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
35
- ENV STREAMLIT_SERVER_PORT=8501
36
-
37
- # Health check
38
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
39
 
40
  # Run the application
41
- CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.fileWatcherType=none", "--browser.gatherUsageStats=false"]
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
+ # Update package lists and install essential packages
7
  RUN apt-get update && apt-get install -y \
8
+ apt-utils \
9
  build-essential \
10
  curl \
 
11
  git \
12
+ && apt-get clean \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Copy requirements file
16
  COPY requirements.txt .
17
 
18
  # Install Python dependencies
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
 
21
  # Copy application code
22
  COPY . .
23
 
24
+ # Expose port for Streamlit
 
 
 
 
25
  EXPOSE 8501
26
 
27
+ # Set environment variables
28
  ENV STREAMLIT_SERVER_HEADLESS=true
29
  ENV STREAMLIT_SERVER_ENABLECORS=false
 
30
  ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
 
 
 
 
31
 
32
  # Run the application
33
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]