handex commited on
Commit
8d77e95
·
1 Parent(s): e31ec0b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -1,15 +1,15 @@
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
- ENV TF_USE_LEGACY_KERAS=1
6
-
7
- ENV PYTHONUNBUFFERED=1
8
 
 
9
  RUN apt-get update && apt-get install -y \
10
  build-essential \
11
  curl \
12
- git \
13
  libglib2.0-0 \
14
  libsm6 \
15
  libxext6 \
@@ -19,15 +19,21 @@ RUN apt-get update && apt-get install -y \
19
  libstdc++6 && \
20
  rm -rf /var/lib/apt/lists/*
21
 
 
22
  COPY requirements.txt .
23
 
 
24
  RUN pip install --upgrade pip && \
25
  pip install --no-cache-dir -r requirements.txt
26
 
 
27
  COPY src/ ./src
28
 
 
29
  EXPOSE 8501
30
 
 
31
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
32
 
 
33
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
 
1
+ # Dockerfile optimized for Hugging Face Space
2
  FROM python:3.11-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # (ENV TF_USE_LEGACY_KERAS satırını SİLDİK)
 
 
8
 
9
+ # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
11
  build-essential \
12
  curl \
 
13
  libglib2.0-0 \
14
  libsm6 \
15
  libxext6 \
 
19
  libstdc++6 && \
20
  rm -rf /var/lib/apt/lists/*
21
 
22
+ # Copy requirements
23
  COPY requirements.txt .
24
 
25
+ # Upgrade pip and install
26
  RUN pip install --upgrade pip && \
27
  pip install --no-cache-dir -r requirements.txt
28
 
29
+ # Copy source code
30
  COPY src/ ./src
31
 
32
+ # Expose Streamlit port
33
  EXPOSE 8501
34
 
35
+ # Healthcheck
36
  HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
37
 
38
+ # Entry point
39
  ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]